Пример #1
0
        public void OpenDialog_DialogActive()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);

            Assert.Equal(fakeDialog, dialogHost.ActiveDialog);
        }
Пример #2
0
        public void OpenDialog_ActiveDialogHostSetToThis()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);

            Assert.Equal(dialogHost, fakeDialog.CurrentDialogHost);
        }
Пример #3
0
        public void DialogOpen_CloseDialog_NoDialogActive()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);
            Assert.Equal(fakeDialog, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();

            Assert.Null(dialogHost.ActiveDialog);
        }
Пример #4
0
        public void TwoDialogsOpen_CloseDialog_FirstOpenDialogActive()
        {
            var fakeDialog1 = new FakeDialog();
            var fakeDialog2 = new FakeDialog();
            var dialogHost  = new DialogHost();

            dialogHost.OpenDialog(fakeDialog1);
            dialogHost.OpenDialog(fakeDialog2);
            Assert.Equal(fakeDialog2, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();

            Assert.Equal(fakeDialog1, dialogHost.ActiveDialog);
        }
Пример #5
0
        public void TwoDialogsOpen_CloseDialogTwice_NoActiveDialog()
        {
            var fakeDialog1 = new FakeDialog();
            var fakeDialog2 = new FakeDialog();
            var dialogHost  = new DialogHost();

            dialogHost.OpenDialog(fakeDialog1);
            dialogHost.OpenDialog(fakeDialog2);
            Assert.Equal(fakeDialog2, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();
            dialogHost.CloseDialog();

            Assert.Null(dialogHost.ActiveDialog);
        }