Exemplo n.º 1
0
        public static void DisposeRunspace()
        {
            CmdletUnitTest.TestRunspace.RunPSCode(
                @"[void]([UIAutomation.CurrentData]::ResetData()); " +
                @"rmo UIAutomation; " +
                @"exit; ");
            CmdletUnitTest.TestRunspace.CloseRunspace();

            if (TestProcess != null)
            {
                try { TestProcess.CloseMainWindow(); }
                catch { }
                try { TestProcess.Kill(); }
                catch { }
            }

            var processes = Process.GetProcessesByName(TestFormProcess);

            foreach (var process in processes)
            {
                try { process.CloseMainWindow(); } catch {}
                try { process.Kill(); } catch {}
            }
            TestProcessStartInfo = null;
            TestProcess          = null;
        }
Exemplo n.º 2
0
        public void TestDeadAfterKilled()
        {
            // Arrange.
            TestProcess process = new TestProcess();

            // Act.
            process.Kill();

            // Assert.
            Assert.IsTrue(process.Dead);
        }
        public void TestDeadAfterKilled()
        {
            // Arrange.
            TestProcess process = new TestProcess();

            // Act.
            process.Kill();

            // Assert.
            Assert.IsTrue(process.Dead);
        }
Exemplo n.º 4
0
        public void TestStartNextProcess()
        {
            // Arrange.
            TestProcess first  = new TestProcess();
            TestProcess second = new TestProcess();

            first.Next = second;
            first.Kill();

            // Act.
            this.game.ProcessManager.AddProcess(first);
            this.game.Update(1.0f);

            // Assert.
            Assert.IsTrue(first.Dead);
            Assert.IsTrue(second.Active);
        }
        public void TestStartNextProcess()
        {
            // Arrange.
            TestProcess first = new TestProcess();
            TestProcess second = new TestProcess();
            first.Next = second;
            first.Kill();

            // Act.
            this.game.ProcessManager.AddProcess(first);
            this.game.Update(1.0f);

            // Assert.
            Assert.IsTrue(first.Dead);
            Assert.IsTrue(second.Active);
        }