Пример #1
0
        public void Any_Empty_False()
        {
            // Arrange
            var subscription = new SubscriptionManager();

            // Act & Assert
            Assert.False(subscription.Any());
        }
Пример #2
0
        public void Any_Empty_True()
        {
            // Arrange
            var subscription = new SubscriptionManager();

            subscription.AddSubscription <UserCreatedEvent, UserEventHandler>();

            // Act & Assert
            Assert.True(subscription.Any());
        }
Пример #3
0
        public void RemoveSubscription_EventNotRegistered_NotRemove()
        {
            // Arrange
            var subscription = new SubscriptionManager();

            // Act & Assert
            var exception = Assert.Throws <EventIsNotRegisteredException>(() => subscription.RemoveSubscription <UserCreatedEvent, UserEventHandler>());

            // Assert
            Assert.NotEmpty(exception.Message);
            Assert.False(subscription.Any());
        }
Пример #4
0
        public void Clear_Subscriptions_Empty()
        {
            // Arrange
            var subscription = new SubscriptionManager();

            subscription.AddSubscription <UserCreatedEvent, UserEventHandler>();

            // Act
            subscription.Clear();

            // Assert
            Assert.False(subscription.Any());
        }
Пример #5
0
        public void RemoveSubscription_EventRegistered_NotRemove()
        {
            // Arrange
            var subscription = new SubscriptionManager();

            subscription.AddSubscription <UserCreatedEvent, UserEventHandler>();

            // Act
            subscription.RemoveSubscription <UserCreatedEvent, UserEventHandler>();

            // Assert
            Assert.False(subscription.Any());
        }