public void Unsubscribe_GeneralSubscriptionHadAction_ActionRemoved( )
        {
            // Arrange
            DummyEventsBroker broker = new DummyEventsBroker( );
            Guid id = broker.SubscribeToAll(null);

            Assert.IsTrue(broker.IsSubscribed(id));

            // Act
            broker.Unsubscribe(id);

            // Assert
            Assert.IsFalse(broker.IsSubscribed(id));
        }
        public void ClearSubscriptions_SubscriptionHadManyActions_AllActionsRemoved( )
        {
            // Arrange
            DummyEventsBroker broker = new DummyEventsBroker( );
            Guid id1 = broker.SubscribeTo <string> (null);
            Guid id2 = broker.SubscribeToAll(null);

            Assert.IsTrue(broker.IsSubscribed(id1));
            Assert.IsTrue(broker.IsSubscribed(id2));

            // Act
            broker.ClearSubscriptions( );

            // Assert
            Assert.IsEmpty(broker.Subscriptions);
            Assert.IsEmpty(broker.GeneralSubscriptions);
        }
        public void IsSubscribed_SubscriptionHasNoAction_ReturnsFalse( )
        {
            // Arrange
            // Act
            DummyEventsBroker broker = new DummyEventsBroker( );

            // Assert
            Assert.IsFalse(broker.IsSubscribed(Guid.NewGuid( )));
        }
        public void SubscribeToAll_GeneralSubscriptionsStoreAction( )
        {
            // Arrange
            DummyEventsBroker broker = new DummyEventsBroker( );

            // Act
            Guid id = broker.SubscribeToAll(null);

            // Assert
            Assert.IsTrue(broker.IsSubscribed(id));
        }
        public void IsSubscribed_GeneralSubscriptionHasAction_ReturnsTrue( )
        {
            // Arrange
            DummyEventsBroker broker = new DummyEventsBroker( );
            Guid id = Guid.NewGuid( );

            // Act
            broker.GeneralSubscriptions.TryAdd(id, new Subscription(null, id, typeof(string)));

            // Assert
            Assert.IsTrue(broker.IsSubscribed(id));
        }