Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }