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 AddNotificationsByFluent_MustReceiveValidationResult_TurnIntoNotifications() { _sut = new Notifier(); ExampleEntity entity = new(); var validator = new Validator(); _sut.AddNotificationsByFluent(validator.Validate(entity)); Assert.Equal(1, _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 AddNotificationsByFluent_ShouldOverwritePreviousList_OverwriteParameterIsTrue() { _sut = new Notifier(); _sut.AddNotification(new("any_key", "any_message")); ExampleEntity entity = new(); var validator = new Validator(); _sut.AddNotificationsByFluent(validator.Validate(entity), true); Assert.Equal(1, _sut.All().Count); }