示例#1
0
        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);
        }
示例#3
0
        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));
        }