Beispiel #1
0
        public void IsToolTipVisible_Raises_PropertyChanged()
        {
            var model   = new NotificationIndicatorViewModel();
            var monitor = model.Monitor();

            model.IsToolTipVisible = true;

            model.IsToolTipVisible.Should().BeTrue();
            monitor.Should().RaisePropertyChangeFor(x => x.IsToolTipVisible);
        }
Beispiel #2
0
        public void AreNotificationsEnabled_Raises_PropertyChanged()
        {
            var model   = new NotificationIndicatorViewModel();
            var monitor = model.Monitor();

            model.AreNotificationsEnabled = true;

            model.AreNotificationsEnabled.Should().BeTrue();
            monitor.Should().RaisePropertyChangeFor(x => x.AreNotificationsEnabled);
        }
Beispiel #3
0
        public void HasUnreadEvents_Raises_PropertyChanged()
        {
            var model   = new NotificationIndicatorViewModel();
            var monitor = model.Monitor();

            model.HasUnreadEvents = true;

            model.HasUnreadEvents.Should().BeTrue();
            monitor.Should().RaisePropertyChangeFor(x => x.HasUnreadEvents);
        }
Beispiel #4
0
        public void Text_Raises_PropertyChanged()
        {
            var model   = new NotificationIndicatorViewModel();
            var monitor = model.Monitor();

            model.ToolTipText = "test";

            model.ToolTipText.Should().Be("test");
            monitor.Should().RaisePropertyChangeFor(x => x.ToolTipText);
        }
Beispiel #5
0
        public void HasUnreadEvents_WithNo_Events_UpdatesTooltipText()
        {
            var model   = new NotificationIndicatorViewModel();
            var monitor = model.Monitor();

            model.IsIconVisible           = true;
            model.AreNotificationsEnabled = true;
            model.IsToolTipVisible        = true;
            monitor.Should().RaisePropertyChangeFor(x => x.IsToolTipVisible);

            model.ToolTipText.Should().Be("You have no unread events.");
        }
Beispiel #6
0
        public void HasUnreadEvents_WithEvents_UpdatesTooltipText()
        {
            var timerMock = new Mock <ITimer>();
            var model     = new NotificationIndicatorViewModel(a => a(), timerMock.Object);
            var monitor   = model.Monitor();

            model.IsIconVisible           = true;
            model.AreNotificationsEnabled = true;
            model.IsToolTipVisible        = true;
            model.SetNotificationEvents(testEvents);

            monitor.Should().RaisePropertyChangeFor(x => x.IsToolTipVisible);

            model.ToolTipText.Should().Be("You have 1 unread event.");
        }