public void TestDestroy()
        {
            TimerManager timerManager = new TimerManager();

            List<String> result = new List<String>();

            notifications = new NotificationCenter(timerManager);
            notifications.Register("name1", Callback1);
            notifications.Register("name2", Callback2);
            notifications.Register("name3", Callback3);

            notifications.Post(this, "name1", result);
            notifications.Post(this, "name2", result);
            notifications.Post(this, "name3", result);

            Check(result);
            Assert.AreEqual(timerManager.Count(), 3);

            notifications.Destroy();
            Assert.AreEqual(timerManager.Count(), 0);

            timerManager.Update(0.016f);
            Check(result);
        }
Beispiel #2
0
        public void TestDestroy()
        {
            TimerManager timerManager = new TimerManager();

            List <String> result = new List <String>();

            notifications = new NotificationCenter(timerManager);
            notifications.Register("name1", Callback1);
            notifications.Register("name2", Callback2);
            notifications.Register("name3", Callback3);

            notifications.Post(this, "name1", result);
            notifications.Post(this, "name2", result);
            notifications.Post(this, "name3", result);

            Check(result);
            Assert.AreEqual(timerManager.Count(), 3);

            notifications.Destroy();
            Assert.AreEqual(timerManager.Count(), 0);

            timerManager.Update(0.016f);
            Check(result);
        }