Esempio n. 1
0
        public void IUserInputBeforeClosedRequestScreenOpen_InteractivelyCloseAllScreens_ContinuationSetsActiveItemToNull()
        {
            var    currentlyOpenFakeScreen = new FakeViewModel();
            var    screenHost   = new ScreenHost();
            Action continuation = () => { };

            currentlyOpenFakeScreen.ContinueIfCanCloseAction += c => continuation = c;
            screenHost.ShowScreen(currentlyOpenFakeScreen);

            screenHost.InteractivelyCloseAllScreens(() => { });
            continuation();

            Assert.Null(screenHost.ActiveItem);
        }
Esempio n. 2
0
        public void IUserInputBeforeClosedRequestScreenOpen_InteractivelyCloseAllScreens_ContinuationCallsContination()
        {
            var    currentlyOpenFakeScreen = new FakeViewModel();
            var    screenHost     = new ScreenHost();
            var    continationRun = false;
            Action continuation   = () => { };

            currentlyOpenFakeScreen.ContinueIfCanCloseAction += c => continuation = c;
            screenHost.ShowScreen(currentlyOpenFakeScreen);

            screenHost.InteractivelyCloseAllScreens(() => continationRun = true);
            continuation();

            Assert.True(continationRun);
        }