public void Should_Add_Mandatory_Arguments() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Settings = new DotNetCoreExecuteSettings(); // When var result = fixture.Run(); // Then Assert.Equal("/Working/bin/Debug/app.dll", result.Args); }
public void Should_Add_Verbose() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Settings.Verbose = true; // When var result = fixture.Run(); // Then Assert.Equal("--verbose /Working/bin/Debug/app.dll", result.Args); }
public void Should_Add_Famework_Version() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./Some Folder/Debug/app.dll"; fixture.Settings.FrameworkVersion = "1.0.3"; // When var result = fixture.Run(); // Then Assert.Equal("--fx-version 1.0.3 \"/Working/Some Folder/Debug/app.dll\"", result.Args); }
public void Should_Add_Host_Arguments() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Settings.DiagnosticOutput = true; // When var result = fixture.Run(); // Then Assert.Equal("--diagnostics \"/Working/bin/Debug/app.dll\"", result.Args); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Arguments = "--args"; fixture.Settings = new DotNetCoreExecuteSettings(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsCakeException(result, "DotNetCore: Process returned an error (exit code 1)."); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Arguments = "--args"; fixture.Settings = new DotNetCoreExecuteSettings(); fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsCakeException(result, "DotNetCore: Process was not started."); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new DotNetCoreExecutorFixture(); fixture.AssemblyPath = "./bin/Debug/app.dll"; fixture.Arguments = "--args"; fixture.Settings = null; fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsArgumentNullException(result, "settings"); }