public void After_All_Subcriber_Be_Removed_Subscriber_Should_Be_Empty() { _subscriberManager.Subscribe <TestMessage, TestMessageHandler>(); _subscriberManager.Subscribe <TestMessage, TestMessageHandler1>(); _subscriberManager.SubscribeDynamic <TestDynamicMessageHandler>("TestDynamicMessageHandler"); _subscriberManager.SubscribeDynamic <TestDynamicMessageHandler1>("TestDynamicMessageHandler"); _subscriberManager.Unsubscribe <TestMessage, TestMessageHandler>(); _subscriberManager.Unsubscribe <TestMessage, TestMessageHandler1>(); _subscriberManager.UnsubscribeDynamic <TestDynamicMessageHandler>("TestDynamicMessageHandler"); _subscriberManager.UnsubscribeDynamic <TestDynamicMessageHandler1>("TestDynamicMessageHandler"); Assert.True(_subscriberManager.IsEmpty); }
public void UnsubscribeDynamic <TMessageHandler>(string messageName) where TMessageHandler : IDynamicMessageHandler { _subscriberManager.UnsubscribeDynamic <TMessageHandler>(messageName); }