예제 #1
0
        public void WhenInvokedWithAParameter_ThenOpensTheChildWindow()
        {
            var childWindow = new TestChildWindow {
            };
            var action      = new PopupChildWindowAction {
                ChildWindow = childWindow
            };
            var trigger = new TestTrigger {
                Actions = { action }
            };
            var args = new InteractionRequestedEventArgs(null, () => { });

            trigger.InvokeActions(args);

            EnqueueConditional(() => childWindow.IsOpen);

            EnqueueCallback(() => { childWindow.Close(); });

            EnqueueTestComplete();
        }
예제 #2
0
        public void WhenChildWindowIsClosed_ThenTheEventCallbackIsExecuted()
        {
            var childWindow = new TestChildWindow {
            };
            var action      = new PopupChildWindowAction {
                ChildWindow = childWindow
            };
            var trigger = new TestTrigger {
                Actions = { action }
            };
            var context         = new Notification();
            var callbackInvoked = false;
            var args            = new InteractionRequestedEventArgs(context, () => { callbackInvoked = true; });

            trigger.InvokeActions(args);

            EnqueueConditional(() => childWindow.IsOpen);

            EnqueueCallback(() => { childWindow.Close(); });

            EnqueueConditional(() => callbackInvoked);

            EnqueueTestComplete();
        }