public void WhenProcessExits_SetsExitCode() { HostClient.WaitForProcessExit(null) .ReturnsForAnyArgs(new WaitForProcessExitResult { exited = true, exitCode = 100 }); Process.WaitForExit(); Assert.Equal(100, Process.ExitCode); }
public void WhenProcessExits_ReturnsTrue() { HostClient.WaitForProcessExit(null) .ReturnsForAnyArgs(new WaitForProcessExitResult { exited = true }); var success = Process.WaitForExit(1); Assert.True(success); }
public void DefaultTimeoutIsInfinite() { HostClient.WaitForProcessExit(null).ReturnsForAnyArgs(new WaitForProcessExitResult()); Process.WaitForExit(); HostClient.Received(1).WaitForProcessExit( Arg.Is <WaitForProcessExitParams>(actual => actual.key == ProcessKey && actual.timeout == Timeout.Infinite ) ); }
public void WhenTimeoutOccurs_ReturnsFalse() { HostClient.WaitForProcessExit(null) .ReturnsForAnyArgs(new WaitForProcessExitResult { exited = false }); var success = Process.WaitForExit(0); Assert.False(success); }
public void ForwardsToHostClient() { HostClient.WaitForProcessExit(null).ReturnsForAnyArgs(new WaitForProcessExitResult()); Process.WaitForExit(100); HostClient.Received(1).WaitForProcessExit( Arg.Is <WaitForProcessExitParams>(actual => actual.key == ProcessKey && actual.timeout == 100 ) ); }