public void ActivateRequestManagementScreen(bool hasRequests)
        {
            var application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);

            application.ActivateRequestmanagementPage(hasRequests ? new [] {"TestEntity"} : null);

            var currentDateTime = ApplicationContext.Now;

            Assert.That(application.ActivePage, Is.InstanceOf<RequestManagementPageViewModel>());

            var activeScreen = (RequestManagementPageViewModel) application.ActivePage;
            Assert.That(activeScreen.Year, Is.EqualTo(currentDateTime.Year));
            Assert.That(activeScreen.Month, Is.EqualTo(currentDateTime.Month));

            if (hasRequests)
            {
                WindowManager.Received(1).ShowDialog(Arg.Is<CreatedRequestsDialogViewModel>(r => r.CreatedRequests.Count == 1 && r.CreatedRequests[0].EntityId == "TestEntity"));
            }
            else
            {
                WindowManager.DidNotReceiveWithAnyArgs().ShowDialog(Arg.Any<object>());
            }
        }
Exemplo n.º 2
0
        public void ActivateRequestManagementScreen(bool hasRequests)
        {
            var application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);

            application.ActivateRequestmanagementPage(hasRequests ? new [] { "TestEntity" } : null);

            var currentDateTime = ApplicationContext.Now;

            Assert.That(application.ActivePage, Is.InstanceOf <RequestManagementPageViewModel>());

            var activeScreen = (RequestManagementPageViewModel)application.ActivePage;

            Assert.That(activeScreen.Year, Is.EqualTo(currentDateTime.Year));
            Assert.That(activeScreen.Month, Is.EqualTo(currentDateTime.Month));

            if (hasRequests)
            {
                WindowManager.Received(1).ShowDialog(Arg.Is <CreatedRequestsDialogViewModel>(r => r.CreatedRequests.Count == 1 && r.CreatedRequests[0].EntityId == "TestEntity"));
            }
            else
            {
                WindowManager.DidNotReceiveWithAnyArgs().ShowDialog(Arg.Any <object>());
            }
        }