예제 #1
0
        public void TickWithFailure()
        {
            var mockFail = new ProcessTest.MockActionProcess(() => { throw new NotImplementedException(); });
            var mock     = new ProcessTest.MockActionProcess();

            this.manager.Spawn(mockFail.Action);
            this.manager.Spawn(mock.Action);

            this.manager.Tick();

            Assert.IsTrue(mockFail.Called);
            Assert.IsTrue(mock.Called);
        }
예제 #2
0
        public void Tick()
        {
            var mock = new ProcessTest.MockActionProcess();
            var p    = this.manager.Spawn(mock.Action, period: 5);

            for (int i = 0; i < 4; ++i)
            {
                this.manager.Tick();
            }

            Assert.AreEqual(4, p.Counter);
            Assert.IsFalse(mock.Called);

            this.manager.Tick();

            Assert.AreEqual(0, p.Counter);
            Assert.IsTrue(mock.Called);
        }