コード例 #1
0
        public void RemoveDynamicSubscriber()
        {
            var submgr = new SubscriptionsManager();

            submgr.AddSubscriber <TestDynamicEventHandler>("Test");
            submgr.RemoveSubscriber <TestDynamicEventHandler>("Test");

            Assert.False(submgr.HasSubscribers("Test"));
        }
コード例 #2
0
        public void RemoveTypedSubscriber()
        {
            var submgr = new SubscriptionsManager();

            submgr.AddSubscriber <TestEvent, TestEventHandler>();
            submgr.RemoveSubscriber <TestEvent, TestEventHandler>();

            Assert.False(submgr.HasSubscribers <TestEvent>());
        }
コード例 #3
0
        public void RemoveDynamicSubscriber_Null()
        {
            var submgr = new SubscriptionsManager();

            Assert.Throws <ArgumentNullException>(() => submgr.RemoveSubscriber <TestDynamicEventHandler>(null));
        }