public void RepeatedSubscription() { IPublisher p = new PublisherImplementingInterface(); ISubscriber s = new SubscriberWithRepeatedEventSubscription(); this.eventbroker.Register(p); Assert.Throws <RepeatedSubscriptionException>( () => this.eventbroker.Register(s)); }
public void PublicationsOnInterfaceAreRecognized() { IPublisher p = new PublisherImplementingInterface(); SubscriberWithEventSubscription s = new SubscriberWithEventSubscription(); this.eventbroker.Register(p); this.eventbroker.Register(s); p.FireEvent(); Assert.IsTrue(s.Called); }
public void RepeatedSubscription() { IPublisher p = new PublisherImplementingInterface(); ISubscriber s = new SubscriberWithRepeatedEventSubscription(); this.eventbroker.Register(p); Assert.Throws<RepeatedSubscriptionException>( () => this.eventbroker.Register(s)); }