예제 #1
0
            public void ReturnsFalseIfNotExited()
            {
                Process.WaitForExit(100).Returns(false);

                int  exitCode = 0;
                bool exited   = ContainerProcess.TryWaitForExit(100, out exitCode);

                Assert.False(exited);
                Process.Received(1).WaitForExit(100);
            }
예제 #2
0
            public void WaitsForProcessAndReturnsExitCode()
            {
                Process.ExitCode.Returns(1);
                Process.WaitForExit(100).Returns(true);

                int  exitCode = 0;
                bool exited   = ContainerProcess.TryWaitForExit(100, out exitCode);

                Assert.Equal(1, exitCode);
                Assert.True(exited);
                Process.Received(1).WaitForExit(100);
            }