public void AcceptSubmitValidationError() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = false }; var viewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live }, Status = ApplicationStatuses.Draft }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertValidationResult(ApprenticeshipApplicationMediatorCodes.Submit.AcceptSubmitValidationError); }
public void GetApplicationViewModelError() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = true }; var savedViewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live } }; var submittedApplicationViewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel(), ViewModelStatus = ApplicationViewModelStatus.Error, ViewModelMessage = "An error message" }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(savedViewModel); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(submittedApplicationViewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Submit.Error, ApplicationPageMessages.SubmitApplicationFailed, UserMessageLevel.Warning, false, true); }
public void IncorrectState() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = true }; var viewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live }, ViewModelStatus = ApplicationViewModelStatus.ApplicationInIncorrectState }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Submit.IncorrectState, MyApplicationsPageMessages.ApplicationInIncorrectState, UserMessageLevel.Info, false); }
public void OfflineVacancy() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.Draft, VacancyDetail = new ApprenticeshipVacancyDetailViewModel { ApplyViaEmployerWebsite = true } }); ApprenticeshipApplicationProvider.Setup( p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())) .Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>( (cid, svm, vm) => vm); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.PreviewAndSubmit(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.PreviewAndSubmit.OfflineVacancy, false); }
public void ShouldIncrementSavedVacancyCount(int savedAndDraftCount) { // Arrange. var viewModel = new SavedVacancyViewModel(); ApprenticeshipApplicationProvider .Setup(mock => mock.SaveVacancy(_testCandidateId, TestVacancyId)) .Returns(viewModel); UserDataProvider .Setup(mock => mock.Get(UserDataItemNames.SavedAndDraftCount)) .Returns(savedAndDraftCount.ToString(CultureInfo.InvariantCulture)); // Act. var response = Mediator.SaveVacancy(_testCandidateId, TestVacancyId); // Assert. UserDataProvider.Verify(mock => mock.Get(UserDataItemNames.SavedAndDraftCount), Times.Once); UserDataProvider.Verify( mock => mock.Push(UserDataItemNames.SavedAndDraftCount, (savedAndDraftCount + 1).ToString(CultureInfo.InvariantCulture)), Times.Once); response.AssertCode(ApprenticeshipApplicationMediatorCodes.SaveVacancy.Ok, true); response.ViewModel.Should().Be(viewModel); }
public void ValidationError() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel { Education = new EducationViewModel { FromYear = "1066" } }, VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.Draft, VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }); ApprenticeshipApplicationProvider.Setup( p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())) .Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>( (cid, svm, vm) => vm); var response = Mediator.Save(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertValidationResult(ApprenticeshipApplicationMediatorCodes.Save.ValidationError); }
public void ValidationError() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel { AboutYou = new AboutYouViewModel() }, VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.Draft, VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live } }); ApprenticeshipApplicationProvider.Setup( p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())) .Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>( (cid, svm, vm) => vm); var response = Mediator.PreviewAndSubmit(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertValidationResult(ApprenticeshipApplicationMediatorCodes.PreviewAndSubmit.ValidationError); }
public void Ok() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = true }; var viewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live } }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.CreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModel()); ApprenticeshipApplicationProvider.Setup( p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())) .Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>( (cid, svm, vm) => vm); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Submit.Ok, false, true); }
public void ValidationError() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = true }; var viewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel { Education = new EducationViewModel { NameOfMostRecentSchoolCollege = "A School", FromYear = "0", ToYear = "0" } }, VacancyDetail = new ApprenticeshipVacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live }, ViewModelStatus = ApplicationViewModelStatus.Error }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertValidationResult(ApprenticeshipApplicationMediatorCodes.Submit.ValidationError); }
public void ErrorGettingApplicationViewModel() { var postedViewModel = new ApprenticeshipApplicationPreviewViewModel { AcceptSubmit = true }; var viewModel = new ApprenticeshipApplicationPreviewViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup( p => p.GetApplicationPreviewViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.CreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModel(MyApplicationsPageMessages.ApplicationNotFound, ApplicationViewModelStatus.ApplicationNotFound)); ApprenticeshipApplicationProvider.Setup( p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())) .Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>( (cid, svm, vm) => vm); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())) .Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId, postedViewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Submit.VacancyNotFound, false); }
public void HasError() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Vacancy not found")); var response = Mediator.Resume(Guid.NewGuid(), InvalidVacancyId); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Resume.HasError, "Vacancy not found", UserMessageLevel.Warning, false); }
public void HasError() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Vacancy not found")); var response = Mediator.Preview(Guid.NewGuid(), InvalidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Preview.HasError, false); }
public void Ok() { ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModelBuilder().WithVacancyStatus(VacancyStatuses.Live).Build); var response = Mediator.Resume(Guid.NewGuid(), ValidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Resume.Ok, false, true); }
public void IfModelHasError_PopulateVacancyTitleAndVacancyReferenceInTheModel() { ApprenticeshipApplicationProvider.Setup(p => p.GetWhatHappensNextViewModel(_someCandidateId, SomeVacancyId)).Returns(new WhatHappensNextViewModel(SomeErrorMessage)); var response = Mediator.WhatHappensNext(_someCandidateId, SomeVacancyId.ToString(), VacancyReference, VacancyTitle); response.AssertCode(ApprenticeshipApplicationMediatorCodes.WhatHappensNext.Ok, true); response.ViewModel.VacancyTitle = VacancyTitle; response.ViewModel.VacancyReference = VacancyReference; }
public void VacancyNotFound() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), InvalidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.ExpiredOrWithdrawn, VacancyDetail = new VacancyDetailViewModel() }); var response = Mediator.Preview(Guid.NewGuid(), InvalidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Preview.VacancyNotFound, false); }
public void IncorrectState() { ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)) .Returns(new ApprenticeshipApplicationViewModelBuilder().WithStatus(ApplicationStatuses.Submitted).Build); var response = Mediator.Resume(Guid.NewGuid(), ValidVacancyId); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Resume.IncorrectState, MyApplicationsPageMessages.ApplicationInIncorrectState, UserMessageLevel.Info, false); }
public void ExpiredOrWithdrawnVacancyReturnsAVacancyNotFound() { ApprenticeshipApplicationProvider.Setup(p => p.GetWhatHappensNextViewModel(_someCandidateId, SomeVacancyId)).Returns(new WhatHappensNextViewModel { Status = ApplicationStatuses.ExpiredOrWithdrawn }); var response = Mediator.WhatHappensNext(_someCandidateId, SomeVacancyId.ToString(), VacancyReference, VacancyTitle); response.Code.Should().Be(ApprenticeshipApplicationMediatorCodes.WhatHappensNext.VacancyNotFound); }
public void ApplicationExpired() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.ExpiredOrWithdrawn }); var response = Mediator.Resume(Guid.NewGuid(), ValidVacancyId); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Resume.HasError, MyApplicationsPageMessages.ApprenticeshipNoLongerAvailable, UserMessageLevel.Warning, false); }
public void Ok() { ApprenticeshipApplicationProvider.Setup(p => p.GetWhatHappensNextViewModel(_someCandidateId, SomeVacancyId)).Returns(new WhatHappensNextViewModel { VacancyStatus = VacancyStatuses.Live }); var response = Mediator.WhatHappensNext(_someCandidateId, SomeVacancyId.ToString(), VacancyReference, VacancyTitle); response.AssertCode(ApprenticeshipApplicationMediatorCodes.WhatHappensNext.Ok, true); }
public void SetUp() { _logService = new Mock <ILogService>(); _candidateService = new Mock <ICandidateService>(); _configurationManager = new Mock <IConfigurationManager>(); _configurationManager.Setup(cm => cm.GetCloudAppSetting <int>("UnsuccessfulApplicationsToShowTraineeshipsPrompt")) .Returns(UnsuccessfulApplications); _apprenticeshipApplicationProvider = new ApprenticeshipApplicationProvider(null, _candidateService.Object, null, _configurationManager.Object, _logService.Object); }
public void VacancyExpired() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { VacancyDetail = new VacancyDetailViewModel { VacancyStatus = VacancyStatuses.Expired } }); var response = Mediator.Apply(Guid.NewGuid(), ValidVacancyId.ToString()); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Apply.VacancyNotFound, false); }
public void Ok() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { VacancyDetail = new VacancyDetailViewModel { VacancyStatus = VacancyStatuses.Live } }); var response = Mediator.Preview(Guid.NewGuid(), ValidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Preview.Ok, true); }
public void HasError() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new VacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Has Error")); var response = Mediator.AutoSave(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.AutoSave.HasError, true); }
public void OfflineVacancy() { ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { VacancyDetail = new VacancyDetailViewModel { ApplyViaEmployerWebsite = true } }); var response = Mediator.Preview(Guid.NewGuid(), ValidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Preview.OfflineVacancy, false); }
public void Error() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Has Error")); var response = Mediator.Save(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Save.Error, ApplicationPageMessages.SaveFailed, UserMessageLevel.Warning, true); }
public void VacancyNotFound() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new VacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.ExpiredOrWithdrawn }); var response = Mediator.AutoSave(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.AutoSave.VacancyNotFound, true); }
public void VacancyNotFound() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new VacancyDetailViewModel(), Status = ApplicationStatuses.ExpiredOrWithdrawn }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); var response = Mediator.Submit(Guid.NewGuid(), ValidVacancyId); response.AssertCode(ApprenticeshipApplicationMediatorCodes.Submit.VacancyNotFound, false); }
public void Error() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new VacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel("Has error") { Status = ApplicationStatuses.Draft }); var response = Mediator.PreviewAndSubmit(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.PreviewAndSubmit.Error, ApplicationPageMessages.PreviewFailed, UserMessageLevel.Warning, true); }
public void AlreadySubmitted() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }; ApprenticeshipApplicationProvider.Setup(p => p.GetApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(new ApprenticeshipApplicationViewModel { Status = ApplicationStatuses.Submitted, VacancyDetail = new ApprenticeshipVacancyDetailViewModel() }); ApprenticeshipApplicationProvider.Setup(p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())).Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>((cid, svm, vm) => vm); var response = Mediator.Save(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertMessage(ApprenticeshipApplicationMediatorCodes.Save.IncorrectState, MyApplicationsPageMessages.ApplicationInIncorrectState, UserMessageLevel.Info, false); }
public void OkDateUpdated() { var viewModel = new ApprenticeshipApplicationViewModel { Candidate = new ApprenticeshipCandidateViewModel(), VacancyDetail = new VacancyDetailViewModel(), DateUpdated = new DateTime(2015, 01, 31) }; ApprenticeshipApplicationProvider.Setup(p => p.GetOrCreateApplicationViewModel(It.IsAny <Guid>(), ValidVacancyId)).Returns(viewModel); ApprenticeshipApplicationProvider.Setup(p => p.PatchApplicationViewModel(It.IsAny <Guid>(), It.IsAny <ApprenticeshipApplicationViewModel>(), It.IsAny <ApprenticeshipApplicationViewModel>())).Returns <Guid, ApprenticeshipApplicationViewModel, ApprenticeshipApplicationViewModel>((cid, svm, vm) => vm); ApprenticeshipApplicationProvider.Setup(p => p.SubmitApplication(It.IsAny <Guid>(), It.IsAny <int>())).Returns(viewModel); var response = Mediator.AutoSave(Guid.NewGuid(), ValidVacancyId, viewModel); response.AssertCode(ApprenticeshipApplicationMediatorCodes.AutoSave.Ok, true); response.ViewModel.DateTimeMessage.Should().Be("12:00:00 AM on 31/1/2015"); }