public void AddNotifications_ShouldOverwritePreviousList_OverwriteParameterIsTrue() { _sut = new Notifier(); _sut.AddNotification(new("any_key", "any_message")); List <Notification> notifications = new() { new("any_key", "any_message"), new("any_key", "any_message") }; _sut.AddNotifications(notifications, true); Assert.Equal(2, _sut.All().Count); }
public void AddNotifications_ShouldReceiveNotifications_IncludeItWithOthers() { _sut = new Notifier(); _sut.AddNotification(new("any_key", "any_message")); List <Notification> notifications = new() { new("any_key", "any_message"), new("any_key", "any_message") }; _sut.AddNotifications(notifications); Assert.Equal(3, _sut.All().Count); }
public void Clear_ShouldRemoveAllNotifications() { _sut = new Notifier(); List <Notification> notifications = new() { new("any_key", "any_message"), new("any_key", "any_message") }; _sut.AddNotifications(notifications); _sut.Clear(); Assert.False(_sut.HasNotifications()); }
public void AddNotifications_MustThrowNotificationIsNullException_NotificationsIsNull() { _sut = new Notifier(); Assert.Throws <NotificationIsNullException>(() => _sut.AddNotifications(null)); }