Exemplo n.º 1
0
        public void TestActionNull()
        {
            ActionEvent athing = new ActionEvent();

            DoStuff(athing);

            Assert.AreEqual(ActionSubscriber.Count, 1);

            athing.SetActionNull();             // Should clear out the list, removing all refs to subscribers

            GC.Collect();
            GC.WaitForPendingFinalizers();

            Assert.AreEqual(ActionSubscriber.Count, 0, "Setting action to null should have cleared sub list");

            athing.OnMyEvent();
        }