コード例 #1
0
        public void TestActiveWhenStarted()
        {
            // Arrange.
            WaitProcess process = new WaitProcess(3.0f);

            // Act.
            this.game.ProcessManager.AddProcess(process);

            // Assert.
            Assert.IsTrue(process.Active);
        }
コード例 #2
0
        public void TestDontUpdateDeadProcess()
        {
            // Arrange.
            WaitProcess process = new WaitProcess(3.0f);
            process.Kill();
            this.game.ProcessManager.AddProcess(process);

            // Act.
            this.game.Update(1.0f);

            // Assert.
            Assert.AreEqual(0.0f, process.TimeElapsed);
        }
コード例 #3
0
        public void TestWaitProcessAliveBeforeExpired()
        {
            // Arrange.
            WaitProcess process = new WaitProcess(3.0f);
            this.game.ProcessManager.AddProcess(process);

            // Act.
            this.game.Update(1.0f);

            // Assert.
            Assert.IsFalse(process.Dead);
        }
コード例 #4
0
        public void TestWaitProcessDeadAfterExpired()
        {
            // Arrange.
            WaitProcess process = new WaitProcess(3.0f);
            this.game.ProcessManager.AddProcess(process);

            // Act.
            this.game.Update(3.0f);

            // Assert.
            Assert.IsTrue(process.Dead);
        }
コード例 #5
0
        public void TestInactiveBeforeStarted()
        {
            // Arrange.
            WaitProcess process = new WaitProcess(3.0f);

            // Assert.
            Assert.IsFalse(process.Active);
        }