public void Any_Empty_False() { // Arrange var subscription = new SubscriptionManager(); // Act & Assert Assert.False(subscription.Any()); }
public void Any_Empty_True() { // Arrange var subscription = new SubscriptionManager(); subscription.AddSubscription <UserCreatedEvent, UserEventHandler>(); // Act & Assert Assert.True(subscription.Any()); }
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()); }
public void Clear_Subscriptions_Empty() { // Arrange var subscription = new SubscriptionManager(); subscription.AddSubscription <UserCreatedEvent, UserEventHandler>(); // Act subscription.Clear(); // Assert Assert.False(subscription.Any()); }
public void RemoveSubscription_EventRegistered_NotRemove() { // Arrange var subscription = new SubscriptionManager(); subscription.AddSubscription <UserCreatedEvent, UserEventHandler>(); // Act subscription.RemoveSubscription <UserCreatedEvent, UserEventHandler>(); // Assert Assert.False(subscription.Any()); }