< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.BuildTools.Indentor
Assembly: CoreWCF.BuildTools.Roslyn3.11
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.BuildTools/src/Indentor.cs
Line coverage
94%
Covered lines: 17
Uncovered lines: 1
Coverable lines: 18
Total lines: 42
Line coverage: 94.4%
Branch coverage
90%
Covered branches: 9
Total branches: 10
Branch coverage: 90%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Increment()100%11100%
Decrement()100%11100%
ToString()90%101092.3%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.BuildTools/src/Indentor.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5
 6namespace CoreWCF.BuildTools;
 7
 8internal sealed class Indentor
 9{
 10    const string ____ = "    ";
 11    const string ________ = "        ";
 12    const string ____________ = "            ";
 13    const string ________________ = "                ";
 14    const string ____________________ = "                    ";
 15    const string ________________________ = "                        ";
 16    const string ____________________________ = "                            ";
 17    const string ________________________________ = "                                ";
 1898018    public int Level { get; private set; } = 0;
 19    public void Increment()
 20    {
 222021        Level++;
 222022    }
 23
 24    public void Decrement()
 25    {
 222026        Level--;
 222027    }
 28
 860429    public override string ToString() => Level switch
 860430    {
 49631        0 => string.Empty,
 116832        1 => ____,
 172833        2 => ________,
 265234        3 => ____________,
 146835        4 => ________________,
 83636        5 => ____________________,
 21637        6 => ________________________,
 2438        7 => ____________________________,
 1639        8 => ________________________________,
 040        _ => throw new InvalidOperationException()
 860441    };
 42}