public void Should_Quote_FileName_On_Windows() { // Given var fixture = new ProcessRunnerFixture(windows: true); // When var result = fixture.GetProcessStartInfo(); // Then Assert.Equal("\"/Program Files/Cake.exe\"", result.FileName); }
public void Should_Not_Coerse_Mono_On_Windows_And_CoreClr() { // Given var fixture = new ProcessRunnerFixture(windows: true); fixture.GivenIsCoreClr(); // When var result = fixture.GetProcessStartInfo(); // Then Assert.Equal("\"/Program Files/Cake.exe\"", result.FileName); }
public void Should_Not_Coerse_Mono_On_Unix_And_CoreClr_With_Config_NoMonoCoersion() { // Given var fixture = new ProcessRunnerFixture(windows: false); fixture.GivenIsCoreClr(); fixture.GivenConfigNoMonoCoersion(); // When var result = fixture.GetProcessStartInfo(); // Then Assert.Equal("/Program Files/Cake.exe", result.FileName); }
public void Should_Not_Log_If_Setting_Silent() { // Given var fixture = new ProcessRunnerFixture(windows: true); fixture.ProcessSettings.Silent = true; // When var result = fixture.GetProcessStartInfo(); // Then fixture.Log .Received(0); }
public void Should_Not_Log_Secret_Arguments() { // Given var fixture = new ProcessRunnerFixture(windows: true); fixture.GivenSecretArgument(); // When var result = fixture.GetProcessStartInfo(); // Then fixture.Log .Received(1) .Verbose(Verbosity.Diagnostic, "Executing: {0}", "\"/Program Files/Cake.exe\" [REDACTED]"); }
public void Should_Not_Coerse_Mono_On_Unix_And_CoreClr_If_Mono_Not_Resolved() { // Given var fixture = new ProcessRunnerFixture(windows: false); fixture.GivenIsCoreClr(); fixture.GivenMonoNotResolved(); // When var result = fixture.GetProcessStartInfo(); // Then Assert.Equal("/Program Files/Cake.exe", result.FileName); fixture.Log .Received(1) .Write(Verbosity.Diagnostic, LogLevel.Verbose, "{0} is a .NET Framework executable, you might need to install Mono for it to execute successfully.", "/Program Files/Cake.exe"); }
public void Should_Coerse_Mono_On_Unix_And_CoreClr() { // Given var fixture = new ProcessRunnerFixture(windows: false); fixture.GivenIsCoreClr(); // When var result = fixture.GetProcessStartInfo(); // Then Assert.Equal("/Program Files/mono.exe", result.FileName); Assert.Equal("\"/Program Files/Cake.exe\"", result.Arguments); fixture.Log .Received(1) .Write(Verbosity.Diagnostic, LogLevel.Verbose, "{0} is a .NET Framework executable, will try execute using Mono.", "/Program Files/Cake.exe"); }