private NotificationIndicatorViewModel SetupModelWithNotifications(bool areEnabled,
                                                                           bool areVisible, SonarQubeNotification[] events)
        {
            var timerMock = new Mock <ITimer>();
            var model     = new NotificationIndicatorViewModel(a => a(), timerMock.Object);

            model.AreNotificationsEnabled = areEnabled;
            model.IsIconVisible           = areVisible;
            model.SetNotificationEvents(events);

            return(model);
        }
Exemplo n.º 2
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.");
        }