public void Should_Add_Mandatory_Arguments() { // Given var fixture = new DotNetCoreRunnerFixture(); // When var result = fixture.Run(); // Then Assert.Equal("run", result.Args); }
public void Should_Add_Additional_Settings() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Settings.Framework = "dnxcore50"; fixture.Settings.Configuration = "Release"; // When var result = fixture.Run(); // Then Assert.Equal("run --framework dnxcore50 --configuration Release", result.Args); }
public void Should_Add_Path_Arguments() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Project = "./tools/tool/"; fixture.Arguments = "--args=\"value\""; // When var result = fixture.Run(); // Then Assert.Equal("run --project \"./tools/tool/\" -- --args=\"value\"", result.Args); }
public void Should_Add_Host_Arguments() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Settings.DiagnosticOutput = true; // When var result = fixture.Run(); // Then Assert.Equal("--diagnostics run", result.Args); }
public void Should_Add_RollForward_Arguments(DotNetCoreRollForward rollForward, string expected) { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Settings.RollForward = rollForward; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Project = "./src/*"; fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1)."); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Project = "./src/*"; fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsCakeException(result, ".NET Core CLI: Process was not started."); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Project = "./src/*"; fixture.Settings = null; fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then Assert.IsArgumentNullException(result, "settings"); }
public void Should_Add_Additional_Settings() { // Given var fixture = new DotNetCoreRunnerFixture(); fixture.Settings.Framework = "dnxcore50"; fixture.Settings.Configuration = "Release"; fixture.Settings.Runtime = "win7-x86"; fixture.Settings.Sources = new[] { "https://api.nuget.org/v3/index.json" }; fixture.Settings.RollForward = DotNetCoreRollForward.Major; // When var result = fixture.Run(); // Then Assert.Equal("run --framework dnxcore50 --configuration Release --runtime win7-x86 --source \"https://api.nuget.org/v3/index.json\" --roll-forward Major", result.Args); }