Ejemplo n.º 1
0
        public void TestRefreshCommandUnauthorized()
        {
            var rootFrameNavigated        = false;
            var stubRootNavigationService = new StubIRootNavigationService();

            stubRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown       = false;
            var stubDialogService = new StubIDialogService();

            stubDialogService.ShowAsync(async message => dialogShown = true);

            var checkRequested   = false;
            var stubMyUvpService = new StubIMyUvpService();

            stubMyUvpService.GetAsync(async() => {
                checkRequested = true;
                return(new ServiceResult <MyUvp>
                {
                    Status = ServiceResultStatus.Unauthorized
                });
            });

            var myUvpViewModel = new MyUvpViewModel(stubMyUvpService,
                                                    stubDialogService, stubRootNavigationService, null);

            myUvpViewModel.RefreshCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(checkRequested);
        }
Ejemplo n.º 2
0
        public void TestBindCommandUnauthorized()
        {
            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var bindRequested       = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.BindAccountAsync(async studentId => {
                bindRequested = true;
                return(new ServiceResult
                {
                    Status = ServiceResultStatus.Unauthorized
                });
            });

            var bindingViewModel = new BindingViewModel(
                stubIRootNavigationService, stubIDialogService,
                stubIStudentService);

            bindingViewModel.BindCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(bindRequested);
        }
Ejemplo n.º 3
0
        public void TestGetCommandUnauthorized()
        {
            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var getRequested             = false;
            var stubIAnnouncementService = new StubIAnnouncementService();

            stubIAnnouncementService.GetAsync(async() => {
                getRequested = true;
                return(new ServiceResult <IEnumerable <Announcement> >
                {
                    Status = ServiceResultStatus.Unauthorized
                });
            });

            var announcementViewModel =
                new AnnouncementViewModel(stubIDialogService,
                                          stubIAnnouncementService, null);

            announcementViewModel.GetCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(getRequested);
        }
Ejemplo n.º 4
0
        public void TestSubmitCommand()
        {
            var voteToSubmit = new Vote {
                Questionnaire =
                    new Questionnaire {
                    Deadline = DateTime.MaxValue
                },
                AnswerCollection = new List <QuestionnaireOption>
                {
                    new QuestionnaireOption()
                }
            };

            var dialogShown        = false;
            var messageShown       = "";
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            Vote voteSubmitted    = null;
            var  submitRequested  = false;
            var  stubIVoteService = new StubIVoteService();

            stubIVoteService.SubmitAsync(async vote => {
                submitRequested = true;
                voteSubmitted   = vote;
                return(new ServiceResult
                {
                    Status = ServiceResultStatus.NoContent
                });
            });

            var stubIRootNavigationService = new StubIRootNavigationService();
            var backNavigated = false;

            stubIRootNavigationService.GoBack(() => backNavigated = true);

            var stubITileService = new StubITileService();
            var updateRequested  = false;

            stubITileService.ForceUpdate(() => updateRequested = true);

            var voteViewModel = new VoteViewModel(stubIDialogService,
                                                  stubIVoteService, stubIRootNavigationService, stubITileService);

            voteViewModel.Vote = voteToSubmit;
            voteViewModel.SubmitCommand.Execute(null);

            Assert.IsTrue(dialogShown);
            Assert.AreSame(VoteViewModel.AnswerSubmittedMessage, messageShown);
            Assert.IsTrue(submitRequested);
            Assert.AreSame(voteToSubmit, voteSubmitted);
            Assert.IsTrue(backNavigated);
            Assert.IsTrue(updateRequested);
        }
Ejemplo n.º 5
0
        public void TestSubmitCommand()
        {
            var groupAssignmentToSubmit = new GroupAssignment {
                HomeworkID = -1, Solution = "http://www.bing.com/",
                Homework   = new Homework {
                    Deadline = DateTime.MaxValue
                }
            };

            var dialogShown        = false;
            var messageShown       = "";
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            GroupAssignment groupAssignmentSubmitted    = null;
            var             submitRequested             = false;
            var             stubIGroupAssignmentService = new StubIGroupAssignmentService();

            stubIGroupAssignmentService.SubmitAsync(async groupAssignment => {
                submitRequested          = true;
                groupAssignmentSubmitted = groupAssignment;
                return(new ServiceResult
                {
                    Status = ServiceResultStatus.NoContent
                });
            });

            var stubIRootNavigationService = new StubIRootNavigationService();
            var backNavigated = false;

            stubIRootNavigationService.GoBack(() => backNavigated = true);

            var stubITileService = new StubITileService();
            var updateRequested  = false;

            stubITileService.ForceUpdate(() => updateRequested = true);

            var groupAssignmentViewModel =
                new GroupAssignmentViewModel(stubIDialogService,
                                             stubIGroupAssignmentService, stubIRootNavigationService, stubITileService);

            groupAssignmentViewModel.GroupAssignment   = groupAssignmentToSubmit;
            groupAssignmentViewModel.GroupAssignmentId =
                groupAssignmentToSubmit.HomeworkID;
            groupAssignmentViewModel.SubmitCommand.Execute(null);

            Assert.IsTrue(dialogShown);
            Assert.AreSame(UvpClient.App.SolutionSubmittedMessage,
                           messageShown);
            Assert.IsTrue(submitRequested);
            Assert.AreSame(groupAssignmentToSubmit, groupAssignmentSubmitted);
            Assert.IsTrue(backNavigated);
            Assert.IsTrue(updateRequested);
        }
Ejemplo n.º 6
0
        public void TestRefreshCommandSucceeded()
        {
            var myUvpToReturn = new MyUvp
            {
                Me = new Student {
                    StudentId = "stuid"
                }
            };

            var rootFrameNavigated        = false;
            var stubRootNavigationService = new StubIRootNavigationService();

            stubRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown       = false;
            var stubDialogService = new StubIDialogService();

            stubDialogService.ShowAsync(async message => dialogShown = true);

            var getRequested = false;
            var myUvpService = new StubIMyUvpService();

            myUvpService.GetAsync(async() => {
                getRequested = true;
                return(new ServiceResult <MyUvp>
                {
                    Status = ServiceResultStatus.OK, Result = myUvpToReturn
                });
            });

            var stubITileService = new StubITileService();
            var studentIdSet     = "";

            stubITileService.SetUpdate(studentId => studentIdSet = studentId);

            var myUvpViewModel = new MyUvpViewModel(myUvpService,
                                                    stubDialogService, stubRootNavigationService, null,
                                                    stubITileService);

            myUvpViewModel.RefreshCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(getRequested);
            Assert.AreSame(myUvpToReturn, myUvpViewModel.MyUvp);
            Assert.AreEqual(myUvpToReturn.Me.StudentId, studentIdSet);
        }
Ejemplo n.º 7
0
        public void TestBindCommandSucceeded()
        {
            var studentIdToRequest = "Student ID";

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = sourcePageType == typeof(MyUvpPage) &&
                                     parameter == null &&
                                     navigationTransition ==
                                     NavigationTransition
                                     .EntranceNavigationTransition);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var studentIdRequested  = "";
            var bindRequested       = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.BindAccountAsync(async studentId => {
                bindRequested      = true;
                studentIdRequested = studentId;
                return(new ServiceResult
                {
                    Status = ServiceResultStatus.NoContent
                });
            });

            var bindingViewModel = new BindingViewModel(
                stubIRootNavigationService, stubIDialogService,
                stubIStudentService);

            bindingViewModel.StudentId = studentIdToRequest;
            bindingViewModel.BindCommand.Execute(null);

            Assert.IsTrue(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(bindRequested);
            Assert.AreEqual(studentIdToRequest, studentIdRequested);
        }
Ejemplo n.º 8
0
        public void TestCheckCommandSucceeded()
        {
            var studentIdToRequest = "Student ID";

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var studentIdRequested  = "";
            var getRequested        = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.GetStudentByStudentIdAsync(async studentId => {
                getRequested       = true;
                studentIdRequested = studentId;
                return(new ServiceResult <Student> {
                    Status = ServiceResultStatus.OK,
                    Result = new Student {
                        StudentId = studentIdToRequest
                    }
                });
            });

            var bindingViewModel = new BindingViewModel(
                stubIRootNavigationService, stubIDialogService,
                stubIStudentService);

            bindingViewModel.StudentId = studentIdToRequest;
            bindingViewModel.CheckCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(getRequested);
            Assert.AreEqual(studentIdToRequest, studentIdRequested);
            Assert.AreEqual(studentIdToRequest,
                            bindingViewModel.Student.StudentId);
        }
Ejemplo n.º 9
0
        public void TestOpenPrivacyDataCommand()
        {
            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate((type, parameter, transition) =>
                                                rootFrameNavigated = type == typeof(PrivacyDataPage) &&
                                                                     parameter == null &&
                                                                     transition == NavigationTransition
                                                                     .DrillInNavigationTransition);

            var myUvpViewModel = new MyUvpViewModel(null, null,
                                                    stubIRootNavigationService, null);

            myUvpViewModel.OpenPrivacyDataCommand.Execute(null);

            Assert.IsTrue(rootFrameNavigated);
        }
Ejemplo n.º 10
0
        public void TestBindCommandOther()
        {
            var messageToShow = "Error Message";

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var messageShown       = "";
            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            var bindRequested       = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.BindAccountAsync(async studentId => {
                bindRequested = true;
                return(new ServiceResult {
                    Status = ServiceResultStatus.Exception,
                    Message = messageToShow
                });
            });

            var bindingViewModel = new BindingViewModel(
                stubIRootNavigationService, stubIDialogService,
                stubIStudentService);

            bindingViewModel.BindCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsTrue(dialogShown);
            Assert.AreEqual(
                UvpClient.App.HttpClientErrorMessage + messageToShow,
                messageShown);
            Assert.IsTrue(bindRequested);
        }
Ejemplo n.º 11
0
        public void TestLoginCommandFailed()
        {
            var errorMessageToShow = "Error Message";

            var loginRequired        = false;
            var stubIIdentityService = new StubIIdentityService();

            stubIIdentityService.LoginAsync(async() => {
                loginRequired = true;
                return(new ServiceResult {
                    Status = ServiceResultStatus.BadRequest,
                    Message = errorMessageToShow
                });
            });

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);


            var dialogShown        = false;
            var errorMessageShown  = "";
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown       = true;
                errorMessageShown = message;
            });

            var loginViewModel = new LoginViewModel(stubIIdentityService,
                                                    stubIRootNavigationService, stubIDialogService);

            loginViewModel.LoginCommand.Execute(null);

            Assert.IsTrue(loginRequired);
            Assert.IsFalse(rootFrameNavigated);
            Assert.IsTrue(dialogShown);
            Assert.AreEqual(
                LoginViewModel.LoginErrorMessage + errorMessageToShow,
                errorMessageShown);
        }
Ejemplo n.º 12
0
        public void TestCheckCommandOther()
        {
            var messageToShow = "Error Message";

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var messageShown       = "";
            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            var getRequested        = false;
            var announcementService = new StubIAnnouncementService();

            announcementService.GetAsync(async() => {
                getRequested = true;
                return(new ServiceResult <IEnumerable <Announcement> > {
                    Status = ServiceResultStatus.Exception,
                    Message = messageToShow
                });
            });

            var announcementViewModel =
                new AnnouncementViewModel(stubIDialogService,
                                          announcementService, null);

            announcementViewModel.GetCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsTrue(dialogShown);
            Assert.AreEqual(
                UvpClient.App.HttpClientErrorMessage + messageToShow,
                messageShown);
            Assert.IsTrue(getRequested);
        }
Ejemplo n.º 13
0
        public void TestCheckCommandOther()
        {
            var messageToShow = "Error Message";

            var rootFrameNavigated        = false;
            var stubRootNavigationService = new StubIRootNavigationService();

            stubRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var messageShown      = "";
            var dialogShown       = false;
            var stubDialogService = new StubIDialogService();

            stubDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            var bindRequested = false;
            var myUvpService  = new StubIMyUvpService();

            myUvpService.GetAsync(async() => {
                bindRequested = true;
                return(new ServiceResult <MyUvp> {
                    Status = ServiceResultStatus.Exception,
                    Message = messageToShow
                });
            });

            var myUvpViewModel = new MyUvpViewModel(myUvpService,
                                                    stubDialogService, stubRootNavigationService, null);

            myUvpViewModel.RefreshCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsTrue(dialogShown);
            Assert.AreEqual(
                UvpClient.App.HttpClientErrorMessage + messageToShow,
                messageShown);
            Assert.IsTrue(bindRequested);
        }
Ejemplo n.º 14
0
        public void TestCheckCommandError()
        {
            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var messageShown       = "";
            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            var bindRequested       = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.GetStudentByStudentIdAsync(async studentId => {
                bindRequested = true;
                return(new ServiceResult <Student>
                {
                    Status = ServiceResultStatus.NotFound
                });
            });

            var bindingViewModel = new BindingViewModel(
                stubIRootNavigationService, stubIDialogService,
                stubIStudentService);

            bindingViewModel.CheckCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsTrue(dialogShown);
            Assert.AreEqual(BindingViewModel.CheckNotFoundErrorMessage,
                            messageShown);
            Assert.IsTrue(bindRequested);
        }
Ejemplo n.º 15
0
        public void TestOpenStudentAssignmentCommand()
        {
            var studentAssignmentToNavigate = new StudentAssignment();

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate((type, parameter, transition) =>
                                                rootFrameNavigated = type == typeof(StudentAssignmentPage) &&
                                                                     parameter == studentAssignmentToNavigate &&
                                                                     transition == NavigationTransition
                                                                     .DrillInNavigationTransition);

            var myUvpViewModel = new MyUvpViewModel(null, null,
                                                    stubIRootNavigationService, null);

            myUvpViewModel.OpenStudentAssignmentCommand.Execute(
                studentAssignmentToNavigate);

            Assert.IsTrue(rootFrameNavigated);
        }
Ejemplo n.º 16
0
        public void TestOpenCommand()
        {
            var announcementToNavigate = new Announcement();

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate((type, parameter, transition) =>
                                                rootFrameNavigated = type == typeof(AnnouncementPage) &&
                                                                     parameter == announcementToNavigate &&
                                                                     transition == NavigationTransition
                                                                     .DrillInNavigationTransition);

            var announcementViewModel =
                new AnnouncementViewModel(null, null,
                                          stubIRootNavigationService);

            announcementViewModel.OpenCommand.Execute(announcementToNavigate);

            Assert.IsTrue(rootFrameNavigated);
        }
Ejemplo n.º 17
0
        public void TestOpenPeerWorkGroupEvaluationCommand()
        {
            var peerWorkGroupEvaluationToNavigate =
                new PeerWorkGroupEvaluation();

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate((type, parameter, transition) =>
                                                rootFrameNavigated =
                                                    type == typeof(PeerWorkGroupEvaluationPage) &&
                                                    parameter == peerWorkGroupEvaluationToNavigate &&
                                                    transition == NavigationTransition
                                                    .DrillInNavigationTransition);

            var myUvpViewModel = new MyUvpViewModel(null, null,
                                                    stubIRootNavigationService, null);

            myUvpViewModel.OpenPeerWorkGroupEvaluationCommand.Execute(
                peerWorkGroupEvaluationToNavigate);

            Assert.IsTrue(rootFrameNavigated);
        }
Ejemplo n.º 18
0
        public void TestGetCommandSucceeded()
        {
            var studentToReturn = new Student();

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = true);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var getMeRequested      = false;
            var stubIStudentService = new StubIStudentService();

            stubIStudentService.GetMeAsync(async() => {
                getMeRequested = true;
                return(new ServiceResult <Student>
                {
                    Status = ServiceResultStatus.OK, Result = studentToReturn
                });
            });

            var meViewModel =
                new MeViewModel(stubIStudentService, stubIDialogService);

            meViewModel.GetCommand.Execute(null);

            Assert.IsFalse(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
            Assert.IsTrue(getMeRequested);
            Assert.AreSame(studentToReturn, meViewModel.Me);
        }
Ejemplo n.º 19
0
        public void TestLoginCommandSucceeded()
        {
            var loginRequired        = false;
            var stubIIdentityService = new StubIIdentityService();

            stubIIdentityService.LoginAsync(async() => {
                loginRequired = true;
                return(new ServiceResult {
                    Status = ServiceResultStatus.OK
                });
            });

            var rootFrameNavigated         = false;
            var stubIRootNavigationService = new StubIRootNavigationService();

            stubIRootNavigationService.Navigate(
                (sourcePageType, parameter, navigationTransition) =>
                rootFrameNavigated = sourcePageType == typeof(MyUvpPage) &&
                                     parameter == null &&
                                     navigationTransition ==
                                     NavigationTransition
                                     .EntranceNavigationTransition);

            var dialogShown        = false;
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => dialogShown = true);

            var loginViewModel = new LoginViewModel(stubIIdentityService,
                                                    stubIRootNavigationService, stubIDialogService);

            loginViewModel.LoginCommand.Execute(null);

            Assert.IsTrue(loginRequired);
            Assert.IsTrue(rootFrameNavigated);
            Assert.IsFalse(dialogShown);
        }
        public void TestSubmitCommand()
        {
            var peerWorkGroupEvaluationToSubmit = new PeerWorkGroupEvaluation {
                Q1 = false, Q2 = 1, Q3 = 1, Q4 = 1, Q5 = 1, Q6 = 1, Q7 = 1,
                Q8 = false, Q9 = ""
            };
            var messageToShow = "Error Message";

            var dialogShown        = false;
            var messageShown       = "";
            var stubIDialogService = new StubIDialogService();

            stubIDialogService.ShowAsync(async message => {
                dialogShown  = true;
                messageShown = message;
            });

            PeerWorkGroupEvaluation peerWorkGroupEvaluationSubmitted = null;
            var submitRequested = false;
            var stubIPeerWorkGroupEvaluationService =
                new StubIPeerWorkGroupEvaluationService();

            stubIPeerWorkGroupEvaluationService.SubmitAsync(
                async peerWorkGroupEvaluation => {
                submitRequested = true;
                peerWorkGroupEvaluationSubmitted = peerWorkGroupEvaluation;
                return(new ServiceResult
                {
                    Status = ServiceResultStatus.NoContent
                });
            });

            var stubIRootNavigationService = new StubIRootNavigationService();
            var backNavigated = false;

            stubIRootNavigationService.GoBack(() => backNavigated = true);

            var stubITileService = new StubITileService();
            var updateRequested  = false;

            stubITileService.ForceUpdate(() => updateRequested = true);

            var peerWorkGroupEvaluationViewModel =
                new PeerWorkGroupEvaluationViewModel(stubIDialogService,
                                                     stubIRootNavigationService,
                                                     stubIPeerWorkGroupEvaluationService, stubITileService);

            peerWorkGroupEvaluationViewModel.PeerWorkGroupEvaluation =
                peerWorkGroupEvaluationToSubmit;
            peerWorkGroupEvaluationViewModel.SubmitCommand.Execute(null);

            Assert.IsTrue(dialogShown);
            Assert.AreSame(
                PeerWorkGroupEvaluationViewModel
                .PeerWorkGroupEvaluationSubmittedMessage, messageShown);
            Assert.IsTrue(submitRequested);
            Assert.AreSame(peerWorkGroupEvaluationToSubmit,
                           peerWorkGroupEvaluationSubmitted);
            Assert.IsTrue(backNavigated);
            Assert.IsTrue(updateRequested);
        }