public void MustSubscribeToClickEvent()
        {
            var button = new NotificationButtonMock();
            var sut    = new AboutNotificationController(appConfig.Object, uiFactory.Object);

            sut.RegisterNotification(button);

            Assert.IsTrue(button.HasSubscribed);
        }
        public void MustCloseWindowWhenTerminating()
        {
            var button = new NotificationButtonMock();
            var window = new Mock <IWindow>();
            var sut    = new AboutNotificationController(appConfig.Object, uiFactory.Object);

            uiFactory.Setup(u => u.CreateAboutWindow(It.IsAny <AppConfig>())).Returns(window.Object);
            sut.RegisterNotification(button);
            button.Click();
            sut.Terminate();

            window.Verify(w => w.Close());
        }
        public void MustOpenOnlyOneWindow()
        {
            var button = new NotificationButtonMock();
            var window = new Mock <IWindow>();
            var sut    = new AboutNotificationController(appConfig.Object, uiFactory.Object);

            uiFactory.Setup(u => u.CreateAboutWindow(It.IsAny <AppConfig>())).Returns(window.Object);
            sut.RegisterNotification(button);
            button.Click();
            button.Click();
            button.Click();
            button.Click();
            button.Click();

            uiFactory.Verify(u => u.CreateAboutWindow(It.IsAny <AppConfig>()), Times.Once);
            window.Verify(u => u.Show(), Times.Once);
            window.Verify(u => u.BringToForeground(), Times.Exactly(4));
        }