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 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. 3
0
        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());
        }
Esempio n. 4
0
 public void AddNotifications_MustThrowNotificationIsNullException_NotificationsIsNull()
 {
     _sut = new Notifier();
     Assert.Throws <NotificationIsNullException>(() => _sut.AddNotifications(null));
 }