diff --git a/tests/Workleap.DotNet.CodingStandards.Tests/PackageFixture.cs b/tests/Workleap.DotNet.CodingStandards.Tests/PackageFixture.cs index 44da116..2c8df3e 100644 --- a/tests/Workleap.DotNet.CodingStandards.Tests/PackageFixture.cs +++ b/tests/Workleap.DotNet.CodingStandards.Tests/PackageFixture.cs @@ -1,5 +1,5 @@ -using System.Diagnostics; using CliWrap; +using CliWrap.Buffered; using Workleap.DotNet.CodingStandards.Tests.Helpers; namespace Workleap.DotNet.CodingStandards.Tests; @@ -26,19 +26,9 @@ public async Task InitializeAsync() } else { - // CliWrap doesn't support UseShellExecute. On Linux, it's easier to use it as "nuget" is a shell script that use mono to run nuget.exe - var psi = new ProcessStartInfo("nuget"); - foreach (var arg in args) - { - psi.ArgumentList.Add(arg); - } - - var p = Process.Start(psi)!; - await p.WaitForExitAsync(); - if (p.ExitCode != 0) - { - throw new InvalidOperationException("Error when running creating the NuGet package"); - } + _ = await Cli.Wrap("nuget") + .WithArguments(args) + .ExecuteBufferedAsync(); } }