< Summary

Information
Class: Amusoft.DotnetNew.Tests.CLI.DotnetCli
Assembly: Amusoft.DotnetNew.Tests
File(s): /home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/CLI/DotnetCli.cs
Tag: 127_14865883074
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 30
Line coverage: 100%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
InstallAsync()50%44100%
UninstallAsync()50%44100%

File(s)

/home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/CLI/DotnetCli.cs

#LineLine coverage
 1using System.Threading;
 2using System.Threading.Tasks;
 3using Amusoft.DotnetNew.Tests.Diagnostics;
 4using Amusoft.DotnetNew.Tests.Scopes;
 5
 6namespace Amusoft.DotnetNew.Tests.CLI;
 7
 8internal static class DotnetCli
 9{
 10  public static async Task<bool> InstallAsync(string path, CancellationToken cancellationToken)
 11  {
 612    using (var scope = new LoggingScope(false))
 13    {
 14      // 106 == already installed
 615      var r = await LoggedDotnetCli.RunDotnetCommandAsync($"new install \"{path}\"", cancellationToken, null, [106]);
 616      scope.ParentScope?.AddResult(new TextResult(r ? $"Install for {path} succeded" : $"Install for {path} failed - {sc
 617      return r;
 18    }
 619  }
 20
 21  public static async Task<bool> UninstallAsync(string path, CancellationToken cancellationToken)
 22  {
 623    using (var scope = new LoggingScope(false))
 24    {
 625      var r = await LoggedDotnetCli.RunDotnetCommandAsync($"new uninstall \"{path}\"", cancellationToken, null, []);
 626      scope.ParentScope?.AddResult(new TextResult(r ? $"Uninstall for {path} succeded" : $"Uninstall for {path} failed -
 627      return r;
 28    }
 629  }
 30}

Methods/Properties

InstallAsync()
UninstallAsync()