public void can_wait_for_process_and_kill_if_required()
        {
            using (var subject = new ProcessHost("./ExampleNoninteractiveProcess.exe", Directory.GetCurrentDirectory()))
            {
                subject.Start("wait");

                var ended = subject.WaitForExit(one_second);

                Assert.That(ended, Is.False, "Ended");
                Assert.That(subject.IsAlive(), Is.True, "Alive");

                subject.Kill();
                var endedAfterKill = subject.WaitForExit(one_second);

                Assert.That(endedAfterKill, Is.True, "ended after kill");
                Assert.That(subject.IsAlive(), Is.False, "Alive after kill");
                Assert.That(subject.ExitCode(), Is.EqualTo(127), "standard killed code");
            }
        }
Example #2
0
 public void KillProcess()
 {
     _host.Kill();
 }
Example #3
0
 public void KillProcess()
 {
     _host.Kill();
     ResetNativeContainer();
 }