Example #1
0
        public void Unsubscribe_Returns_True_If_Subscriber_Is_Subscribed()
        {
            var messageChannel = new MessageChannel();

            var subscriber = messageChannel.Subscribe <string>();

            Assert.True(messageChannel.Unsubscribe(subscriber));
        }
Example #2
0
        public void Unsubscribe_Returns_False_If_Subscribers_MessageType_IsNull()
        {
            var mockSubscriber = new Mock <ISubscriber>();

            var messageChannel = new MessageChannel();

            Assert.False(messageChannel.Unsubscribe(mockSubscriber.Object));
        }
Example #3
0
        public void Unsubscribe_Returns_False_If_Subscriber_Is_Not_Subscribed()
        {
            var mockSubscriber = new Mock <ISubscriber>();

            mockSubscriber.SetupGet(x => x.MessageType).Returns(typeof(string));

            var messageChannel = new MessageChannel();

            Assert.False(messageChannel.Unsubscribe(mockSubscriber.Object));
        }
Example #4
0
        public void Unsubscribe_Returns_False_If_Subscriber_Is_Null()
        {
            var messageChannel = new MessageChannel();

            Assert.False(messageChannel.Unsubscribe(null));
        }
Example #5
0
 public void Dispose()
 {
     _c.Unsubscribe(_obs);
 }