public void WhenWindowContentImplementsIInteractionRequestAware_ShouldSetUpProperties()
        {
            MockInteractionRequestAwareElement element = new MockInteractionRequestAwareElement();
            TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction();
            popupWindowAction.WindowContent = element;

            INotification notification = new Notification();
            notification.Title = "Title";
            notification.Content = "Content";

            Window window = popupWindowAction.GetWindow(notification);
            Assert.IsNotNull(element.Notification);
            Assert.ReferenceEquals(element.Notification, notification);
            Assert.IsNotNull(element.FinishInteraction);
        }
        public void WhenWindowContentIsSet_ShouldWrapContentInCommonWindow()
        {
            MockFrameworkElement element = new MockFrameworkElement();
            TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction();
            popupWindowAction.WindowContent = element;

            INotification notification = new Notification();
            notification.Title = "Title";
            notification.Content = "Content";

            Window window = popupWindowAction.GetWindow(notification);
            Assert.IsNotInstanceOfType(window, typeof(DefaultNotificationWindow));
            Assert.IsNotInstanceOfType(window, typeof(DefaultConfirmationWindow));
            Assert.IsInstanceOfType(window, typeof(Window));
        }
Пример #3
0
        public void WhenWindowContentImplementsIInteractionRequestAware_ShouldSetUpProperties()
        {
            MockInteractionRequestAwareElement element           = new MockInteractionRequestAwareElement();
            TestablePopupWindowAction          popupWindowAction = new TestablePopupWindowAction();

            popupWindowAction.WindowContent = element;

            INotification notification = new Notification();

            notification.Title   = "Title";
            notification.Content = "Content";

            Window window = popupWindowAction.GetWindow(notification);

            Assert.IsNotNull(element.Notification);
            Assert.ReferenceEquals(element.Notification, notification);
            Assert.IsNotNull(element.FinishInteraction);
        }
Пример #4
0
        public void WhenWindowContentIsSet_ShouldWrapContentInCommonWindow()
        {
            MockFrameworkElement      element           = new MockFrameworkElement();
            TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction();

            popupWindowAction.WindowContent = element;

            INotification notification = new Notification();

            notification.Title   = "Title";
            notification.Content = "Content";

            Window window = popupWindowAction.GetWindow(notification);

            Assert.IsNotInstanceOfType(window, typeof(DefaultNotificationWindow));
            Assert.IsNotInstanceOfType(window, typeof(DefaultConfirmationWindow));
            Assert.IsInstanceOfType(window, typeof(Window));
        }
        public void WhenWindowContentIsNotSet_ShouldUseDefaultWindowForConfirmations()
        {
            TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction();
            popupWindowAction.IsModal = true;
            popupWindowAction.CenterOverAssociatedObject = true;

            INotification notification = new Confirmation();
            notification.Title = "Title";
            notification.Content = "Content";

            Assert.AreEqual(popupWindowAction.IsModal, true);
            Assert.AreEqual(popupWindowAction.CenterOverAssociatedObject, true);

            Window window = popupWindowAction.GetWindow(notification);
            Assert.IsInstanceOfType(window, typeof(DefaultConfirmationWindow));

            DefaultConfirmationWindow defaultWindow = window as DefaultConfirmationWindow;
            Assert.ReferenceEquals(defaultWindow.Confirmation, notification);
        }
Пример #6
0
        public void WhenWindowContentIsNotSet_ShouldUseDefaultWindowForConfirmations()
        {
            TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction();

            popupWindowAction.IsModal = true;
            popupWindowAction.CenterOverAssociatedObject = true;

            INotification notification = new Confirmation();

            notification.Title   = "Title";
            notification.Content = "Content";

            Assert.AreEqual(popupWindowAction.IsModal, true);
            Assert.AreEqual(popupWindowAction.CenterOverAssociatedObject, true);

            Window window = popupWindowAction.GetWindow(notification);

            Assert.IsInstanceOfType(window, typeof(DefaultConfirmationWindow));

            DefaultConfirmationWindow defaultWindow = window as DefaultConfirmationWindow;

            Assert.ReferenceEquals(defaultWindow.Confirmation, notification);
        }