< Summary

Information
Class: Amusoft.DotnetNew.Tests.Internals.PathHelper
Assembly: Amusoft.DotnetNew.Tests
File(s): /home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Internals/PathHelper.cs
Tag: 127_14865883074
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 18
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AbsoluteTrimPathEnd(...)75%44100%

File(s)

/home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Internals/PathHelper.cs

#LineLine coverage
 1
 2using System;
 3using System.IO;
 4
 5namespace Amusoft.DotnetNew.Tests.Internals;
 6
 7internal static class PathHelper
 8{
 9  public static string AbsoluteTrimPathEnd(string input, int count)
 10  {
 5011    for (int i = 0; i < count; i++)
 12    {
 1713      input = Path.GetDirectoryName(input) ?? throw new Exception($"Directory for {input} could not be found");
 14    }
 15
 816    return input;
 17  }
 18}