public void TestNoReentrancy() { DummyAILogic objectToNotify = new DummyAILogic(); objectToNotify.RegisterToUpdate(EUpdatePass.Last); Assert.ThrowsException <SecurityException> (delegate { m_Updater.Update(); }); }
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); }