Пример #1
0
        public void TestNoReentrancy()
        {
            DummyAILogic objectToNotify = new DummyAILogic();

            objectToNotify.RegisterToUpdate(EUpdatePass.Last);

            Assert.ThrowsException <SecurityException> (delegate { m_Updater.Update(); });
        }
Пример #2
0
        public void TestRegisterToUpdate()
        {
            DummyAILogic objectToNotify = new DummyAILogic();

            objectToNotify.RegisterToUpdate(EUpdatePass.AI);

            m_Updater.Update();
            Assert.IsTrue(objectToNotify.m_UpdateCount == 1);

            m_Updater.Update();
            Assert.IsTrue(objectToNotify.m_UpdateCount == 2);
        }