mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Run test dummy through the app host
This commit is contained in:
@@ -41,11 +41,9 @@ public class CancellationSpecs : SpecsBase
|
||||
PipeTarget.ToStringBuilder(stdOutBuffer)
|
||||
);
|
||||
|
||||
var command = Cli.Wrap("dotnet")
|
||||
.WithArguments(a => a
|
||||
.Add(Dummy.Program.Location)
|
||||
.Add("cancel-test")
|
||||
) | pipeTarget;
|
||||
var command =
|
||||
Cli.Wrap(Dummy.Program.FilePath).WithArguments("cancel-test") |
|
||||
pipeTarget;
|
||||
|
||||
// Act & assert
|
||||
await Assert.ThrowsAnyAsync<OperationCanceledException>(async () =>
|
||||
|
||||
@@ -27,11 +27,9 @@ public class ConsoleSpecs : SpecsBase
|
||||
// Can't verify our own console output, so using an external process for this test
|
||||
|
||||
// Arrange
|
||||
var command = "Hello world" | Cli.Wrap("dotnet")
|
||||
.WithArguments(a => a
|
||||
.Add(Dummy.Program.Location)
|
||||
.Add("console-test")
|
||||
);
|
||||
var command =
|
||||
"Hello world" |
|
||||
Cli.Wrap(Dummy.Program.FilePath).WithArguments("console-test");
|
||||
|
||||
// Act
|
||||
var result = await command.ExecuteBufferedAsync();
|
||||
|
||||
@@ -32,11 +32,9 @@ public class DirectivesSpecs : SpecsBase
|
||||
cts.Cancel();
|
||||
}
|
||||
|
||||
var command = Cli.Wrap("dotnet")
|
||||
.WithArguments(a => a
|
||||
.Add(Dummy.Program.Location)
|
||||
.Add("[debug]")
|
||||
) | HandleStdOut;
|
||||
var command =
|
||||
Cli.Wrap(Dummy.Program.FilePath).WithArguments("[debug]") |
|
||||
HandleStdOut;
|
||||
|
||||
// Act & assert
|
||||
try
|
||||
|
||||
@@ -169,11 +169,8 @@ public class EnvironmentSpecs : SpecsBase
|
||||
// System.Environment when they are not provided explicitly to CliApplication.
|
||||
|
||||
// Arrange
|
||||
var command = Cli.Wrap("dotnet")
|
||||
.WithArguments(a => a
|
||||
.Add(Dummy.Program.Location)
|
||||
.Add("env-test")
|
||||
)
|
||||
var command = Cli.Wrap(Dummy.Program.FilePath)
|
||||
.WithArguments("env-test")
|
||||
.WithEnvironmentVariables(e => e
|
||||
.Set("ENV_TARGET", "Mars")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user