public override void Given() { HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); HttpContextAccessor.HttpContext.Returns(new DefaultHttpContext { User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.GivenName, _givename), new Claim(ClaimTypes.Surname, _surname), new Claim(ClaimTypes.Email, _email) })) }); CreateMapper(); BulkRegistrationRequest = new BulkProcessRequest { AoUkprn = Ukprn }; BulkRegistrationResponse = new BulkProcessResponse { IsSuccess = false, BlobUniqueReference = Guid.NewGuid(), ErrorFileSize = 1.5 }; UploadRegistrationsRequestViewModel = new UploadRegistrationsRequestViewModel { AoUkprn = Ukprn, File = FormFile }; InternalApiClient.ProcessBulkRegistrationsAsync(BulkRegistrationRequest).Returns(BulkRegistrationResponse); Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); }
public override void Given() { registrationApiClientResponse = new RegistrationDetails { ProfileId = 1, Uln = Uln, Firstname = "Test", Lastname = "Last", AoUkprn = AoUkprn, ProviderUkprn = 34567890, PathwayLarId = "10000112", }; ViewModel = new ChangeSpecialismQuestionViewModel { ProfileId = 1, HasLearnerDecidedSpecialism = false }; Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); InternalApiClient.GetRegistrationDetailsAsync(AoUkprn, ViewModel.ProfileId, RegistrationPathwayStatus.Active) .Returns(registrationApiClientResponse); InternalApiClient.UpdateRegistrationAsync(Arg.Is <ManageRegistration> (x => x.Uln == registrationApiClientResponse.Uln && x.FirstName == registrationApiClientResponse.Firstname && x.LastName == registrationApiClientResponse.Lastname && x.ProviderUkprn == registrationApiClientResponse.ProviderUkprn && x.CoreCode == registrationApiClientResponse.PathwayLarId && x.SpecialismCodes.Count() == 0)) .Returns(ApiClientResponse); }
public override void Given() { MockResult.IsSuccess = true; MockResult.IsModified = true; RegistrationLoader.ProcessSpecialismQuestionChangeAsync(AoUkprn, ViewModel).Returns(MockResult); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; _selectProviderViewModel = new SelectProviderViewModel { ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; _reRegisterProviderViewModel = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = "12345678" }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reRegisterProviderViewModel }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegisteredTqAoProviderDetailsAsync(AoUkprn).Returns(_selectProviderViewModel); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { Uln = 1234567890, ProfileId = ProfileId, Status = RegistrationPathwayStatus.Withdrawn }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { _reregisterProviderViewModel = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; var cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(AoUkprn, _providerUkprn).Returns(_selectCoreViewModel); Controller.ModelState.AddModelError(nameof(ReregisterCoreViewModel.SelectedCoreCode), SelectCoreContent.Validation_Select_Core_Required); }
public override void Given() { ViewModel = new ChangeSpecialismViewModel { SelectedSpecialismCode = "SPL12345", PathwaySpecialisms = new PathwaySpecialismsViewModel { Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 11, Code = "SPL12345" }, new SpecialismDetailsViewModel { Id = 22, Code = "SPL12346" }, new SpecialismDetailsViewModel { Id = 33, Code = "SPL12347" }, } } }; mockResponse = new ManageRegistrationResponse { IsModified = true, IsSuccess = true }; RegistrationLoader.ProcessSpecialismChangeAsync(AoUkprn, ViewModel).Returns(mockResponse); }
public override void Given() { mockPathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = "11111" }, new SpecialismDetailsViewModel { Id = 2, Code = "77777" }, new SpecialismDetailsViewModel { Id = 3, Code = "99999" }, new SpecialismDetailsViewModel { Id = 4, Code = "33333" }, } }; mockChangeSpecialismViewModel = new ChangeSpecialismViewModel { ProfileId = ProfileId, CoreCode = "12345678", PathwaySpecialisms = mockPathwaySpecialismsViewModel, SpecialismCodes = new List <string> { "77777" } }; RegistrationLoader.GetRegistrationProfileAsync <ChangeSpecialismViewModel>(AoUkprn, ProfileId).Returns(mockChangeSpecialismViewModel); RegistrationLoader.GetPathwaySpecialismsByPathwayLarIdAsync(AoUkprn, mockChangeSpecialismViewModel.CoreCode).Returns(mockPathwaySpecialismsViewModel); }
public override void Given() { BulkRegistrationResponse = new BulkProcessResponse { IsSuccess = true, Stats = new BulkUploadStats { TotalRecordsCount = 10, NewRecordsCount = 5, AmendedRecordsCount = 3, UnchangedRecordsCount = 2 } }; UploadRegistrationsRequestViewModel = new UploadRegistrationsRequestViewModel { AoUkprn = Ukprn, File = FormFile }; UploadRegistrationsResponseViewModel = new UploadRegistrationsResponseViewModel { IsSuccess = true, Stats = new BulkUploadStatsViewModel { TotalRecordsCount = 10, NewRecordsCount = 5, AmendedRecordsCount = 3, UnchangedRecordsCount = 2 } }; Mapper.Map <BulkProcessRequest>(UploadRegistrationsRequestViewModel).Returns(BulkRegistrationRequest); Mapper.Map <UploadRegistrationsResponseViewModel>(BulkRegistrationResponse).Returns(UploadRegistrationsResponseViewModel); InternalApiClient.ProcessBulkRegistrationsAsync(BulkRegistrationRequest).Returns(BulkRegistrationResponse); Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); }
public override void Given() { _coreCode = "10000111"; _providerUkprn = 12345678; ApiClientResponse = false; mockApiClientResponse = new RegistrationDetails { ProfileId = 1, Uln = Uln, ProviderUkprn = _providerUkprn, PathwayLarId = "70000111", }; ViewModel = new ReregisterViewModel { ReregisterProvider = new ReregisterProviderViewModel { ProfileId = ProfileId }, ReregisterCore = new ReregisterCoreViewModel { ProfileId = ProfileId, SelectedCoreCode = _coreCode } }; Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); InternalApiClient.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(mockApiClientResponse); InternalApiClient.ReregistrationAsync(Arg.Any <ReregistrationRequest>()).Returns(ApiClientResponse); }
public override void Given() { MockResult.IsModified = false; RegistrationLoader.ProcessDateofBirthChangeAsync(AoUkprn, ViewModel) .Returns(MockResult); }
public override void Given() { _selectProviderViewModel = new SelectProviderViewModel { SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; cacheResult = new RegistrationViewModel { SelectProvider = _selectProviderViewModel, SelectCore = _selectCoreViewModel }; RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(Ukprn, _providerUkprn).Returns(_selectCoreViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { _selectedAcademicYear = ((int)AcademicYear.Year2020).ToString(); _ulnViewModel = new UlnViewModel { Uln = "1234567890" }; _learnersNameViewModel = new LearnersNameViewModel { Firstname = "First", Lastname = "Last" }; _dateofBirthViewModel = new DateofBirthViewModel { Day = "01", Month = "01", Year = "2020" }; _selectProviderViewModel = new SelectProviderViewModel { SelectedProviderUkprn = "98765432", SelectedProviderDisplayName = "Barnsley College (98765432)" }; _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = _coreCode, SelectedCoreDisplayName = $"Education ({_coreCode})", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _specialismQuestionViewModel = new SpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayCode = _coreCode, PathwayName = "Education", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Code = "7654321", Name = "Test Education", DisplayName = "Test Education (7654321)", IsSelected = true } } }; _academicYearViewModel = new SelectAcademicYearViewModel { SelectedAcademicYear = _selectedAcademicYear.ToString() }; cacheResult = new RegistrationViewModel { Uln = _ulnViewModel, LearnersName = _learnersNameViewModel, DateofBirth = _dateofBirthViewModel, SelectProvider = _selectProviderViewModel, SelectCore = _selectCoreViewModel, SpecialismQuestion = _specialismQuestionViewModel, SelectAcademicYear = _academicYearViewModel }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayName = "Test Pathway", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = "345678", Name = "Test Specialism", DisplayName = "Test Specialism (345678)", IsSelected = true } } }; SelectSpecialismViewModel = new SelectSpecialismViewModel { IsChangeMode = true }; RegistrationLoader.GetPathwaySpecialismsByPathwayLarIdAsync(Ukprn, _coreCode).Returns(_pathwaySpecialismsViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { SelectProviderViewModel = new SelectProviderViewModel(); Controller.ModelState.AddModelError("SelectedProviderUkprn", SelectProviderContent.Validation_Select_Provider_Required); var cacheResult = new RegistrationViewModel { Uln = new UlnViewModel { Uln = "1234567890" }, LearnersName = new LearnersNameViewModel { Firstname = "First", Lastname = "Last" }, DateofBirth = new DateofBirthViewModel { Day = DateTime.Now.Day.ToString(), Month = DateTime.Now.Month.ToString(), Year = DateTime.Now.Year.ToString() } }; CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); _selectProviderViewModel = new SelectProviderViewModel { ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; RegistrationLoader.GetRegisteredTqAoProviderDetailsAsync(Ukprn).Returns(_selectProviderViewModel); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; _reRegisterProviderViewModel = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = _providerUkprn.ToString() }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reRegisterProviderViewModel, ReregisterCore = _reregisterCoreViewModel }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(AoUkprn, _providerUkprn).Returns(_reregisterCoreViewModel); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { IsChangeMode = true; _ulnViewModel = new UlnViewModel { Uln = "1234567890" }; _learnersNameViewModel = new LearnersNameViewModel { Firstname = "First", Lastname = "Last" }; _dateofBirthViewModel = new DateofBirthViewModel { Day = "01", Month = "01", Year = "2020" }; _selectProviderViewModel = new SelectProviderViewModel { SelectedProviderUkprn = "98765432", SelectedProviderDisplayName = "Barnsley College (98765432)", ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Barnsley College (98765432)", Value = "98765432" } } }; cacheResult = new RegistrationViewModel { Uln = _ulnViewModel, LearnersName = _learnersNameViewModel, DateofBirth = _dateofBirthViewModel, SelectProvider = _selectProviderViewModel }; RegistrationLoader.GetRegisteredTqAoProviderDetailsAsync(Ukprn).Returns(_selectProviderViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { // input variance. var isChangeStartedFromCore = false; IsChangeMode = true; // mock setup mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; cacheResult = new ReregisterViewModel { ReregisterCore = new ReregisterCoreViewModel { IsChangeMode = isChangeStartedFromCore, CoreCodeAtTheTimeOfWithdrawn = "999", SelectedCoreCode = "123" }, ReregisterProvider = new ReregisterProviderViewModel(), ReregisterAcademicYear = new ReregisterAcademicYearViewModel() }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { _providerUkprn = 12345678; mockApiClientResponse = new RegistrationDetails { ProfileId = 1, ProviderUkprn = 3425678, PathwayLarId = "20000113", }; var mockProviderPathwayDetailsApiClientResponse = new List <PathwayDetails> { new PathwayDetails { Id = 1, Name = "Test", Code = "10000111" }, new PathwayDetails { Id = 2, Name = "Display", Code = "10000112" } }; ViewModel = new ChangeProviderViewModel { ProfileId = 1, SelectedProviderUkprn = _providerUkprn.ToString() }; Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); InternalApiClient.GetRegistrationDetailsAsync(AoUkprn, ViewModel.ProfileId, RegistrationPathwayStatus.Active).Returns(mockApiClientResponse); InternalApiClient.GetRegisteredProviderPathwayDetailsAsync(AoUkprn, _providerUkprn).Returns(mockProviderPathwayDetailsApiClientResponse); }
public override void Given() { MockResult = null; RegistrationLoader.ProcessProfileNameChangeAsync(AoUkprn, ViewModel) .Returns(MockResult); }
public override void Given() { SelectCoreViewModel = new SelectCoreViewModel(); Controller.ModelState.AddModelError("SelectedCoreCode", SelectCoreContent.Validation_Select_Core_Required); _selectProviderViewModel = new SelectProviderViewModel { SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Test Provider", Value = _providerUkprn.ToString() } } }; _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; var cacheResult = new RegistrationViewModel { SelectProvider = _selectProviderViewModel, SelectCore = _selectCoreViewModel }; CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(Ukprn, _providerUkprn).Returns(_selectCoreViewModel); }
public override void Given() { _specialismQuestionViewModel = new ReregisterSpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayName = "Test Pathway", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = "345678", Name = "Test Specialism", DisplayName = "Test Specialism (345678)", IsSelected = true } } }; _selectSpecialismViewModel = new ReregisterSpecialismViewModel { PathwaySpecialisms = _pathwaySpecialismsViewModel }; cacheResult = new ReregisterViewModel { SpecialismQuestion = _specialismQuestionViewModel, ReregisterSpecialisms = _selectSpecialismViewModel, ReregisterAcademicYear = null }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader .GetRegistrationDetailsAsync(Ukprn, ProfileId, RegistrationPathwayStatus.Withdrawn) .Returns(new RegistrationDetailsViewModel { Status = RegistrationPathwayStatus.Withdrawn }); }
public override void Given() { MockResult.IsSuccess = false; MockResult.IsModified = true; RegistrationLoader.ProcessProviderChangesAsync(AoUkprn, ViewModel).Returns(MockResult); }
public override void Given() { IsChangeMode = true; _reregisterProviderViewModel = new ReregisterProviderViewModel { IsChangeMode = true, SelectedProviderUkprn = _providerUkprn.ToString(), SelectedProviderDisplayName = "Barnsley College (98765432)", ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Barnsley College (98765432)", Value = _providerUkprn.ToString() } } }; _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel, ReregisterCore = _reregisterCoreViewModel }; _registrationDetailsViewModel = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(AoUkprn, _providerUkprn).Returns(_reregisterCoreViewModel); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(_registrationDetailsViewModel); CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = _coreCode, CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _specialismQuestionViewModel = new SpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true }; cacheResult = new RegistrationViewModel { SelectCore = _selectCoreViewModel, SpecialismQuestion = _specialismQuestionViewModel }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayName = "Test Pathway", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = "345678", Name = "Test Specialism", DisplayName = "Test Specialism (345678)" } } }; RegistrationLoader.GetPathwaySpecialismsByPathwayLarIdAsync(Ukprn, _coreCode).Returns(_pathwaySpecialismsViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { _reregisterProviderViewModel = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; _selectCoreViewModel = new SelectCoreViewModel { CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; _registrationDetailsViewModel = new RegistrationDetailsViewModel { ProfileId = ProfileId, PathwayLarId = _coreCodeAtTheTimeOfWithdrawn, Status = _registrationPathwayStatus }; var cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel }; ViewModel.ProfileId = ProfileId; ViewModel.SelectedCoreCode = _selectedCoreCode; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(AoUkprn, _providerUkprn).Returns(_selectCoreViewModel); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(_registrationDetailsViewModel); }
public override void Given() { IsChangeMode = true; ViewModel = new ReregisterCoreViewModel { ProfileId = ProfileId, SelectedCoreCode = _coreCodeAtTheTimeOfWithdrawn, IsChangeMode = true, CoreCodeAtTheTimeOfWithdrawn = _coreCodeAtTheTimeOfWithdrawn }; _reregisterProviderViewModel = new ReregisterProviderViewModel { SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Test Provider", Value = _providerUkprn.ToString() } } }; _academicYearViewModel = new ReregisterAcademicYearViewModel { SelectedAcademicYear = "2020" }; var cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel, ReregisterAcademicYear = _academicYearViewModel }; _registrationDetailsViewModel = new RegistrationDetailsViewModel { ProfileId = 1, PathwayLarId = _coreCodeAtTheTimeOfWithdrawn, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(_registrationDetailsViewModel); CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { _coreCode = "10000111"; _providerUkprn = 12345678; ApiClientResponse = true; ViewModel = new ReregisterViewModel { ReregisterProvider = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = _providerUkprn.ToString() }, ReregisterCore = new ReregisterCoreViewModel { ProfileId = ProfileId, SelectedCoreCode = _coreCode }, SpecialismQuestion = new ReregisterSpecialismQuestionViewModel { HasLearnerDecidedSpecialism = false }, ReregisterAcademicYear = new ReregisterAcademicYearViewModel { SelectedAcademicYear = "2020" } }; mockApiClientResponse = new RegistrationDetails { ProfileId = 1, Uln = Uln, ProviderUkprn = _providerUkprn, PathwayLarId = "34567111", }; Loader = new RegistrationLoader(Mapper, Logger, InternalApiClient, BlobStorageService); InternalApiClient.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(mockApiClientResponse); InternalApiClient.ReregistrationAsync(Arg.Any <ReregistrationRequest>()).Returns(ApiClientResponse); }
public override void Given() { _dateOfBirthViewModel = new DateofBirthViewModel { Day = DateTime.Now.Day.ToString(), Month = DateTime.Now.Month.ToString(), Year = DateTime.Now.Year.ToString() }; _selectProviderViewModel = new SelectProviderViewModel { SelectedProviderUkprn = _providerUkprn.ToString(), ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; _selectCoreViewModel = new SelectCoreViewModel { CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; cacheResult = new RegistrationViewModel { SelectProvider = _selectProviderViewModel }; RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(Ukprn, _providerUkprn).Returns(_selectCoreViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { ViewModel = new ReregisterProviderViewModel { ProfileId = ProfileId, SelectedProviderUkprn = "1234567890", IsChangeMode = true }; _selectProviderViewModel = new SelectProviderViewModel { ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; RegistrationLoader.GetRegisteredTqAoProviderDetailsAsync(AoUkprn).Returns(_selectProviderViewModel); cacheResult = new ReregisterViewModel { ReregisterProvider = new ReregisterProviderViewModel { SelectedProviderUkprn = "PrevOne" }, ReregisterCore = new ReregisterCoreViewModel(), SpecialismQuestion = new ReregisterSpecialismQuestionViewModel(), ReregisterSpecialisms = new ReregisterSpecialismViewModel(), ReregisterAcademicYear = new ReregisterAcademicYearViewModel() }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { WithdrawBackLinkOption = WithdrawBackLinkOptions.CannotChangeProviderAndCorePage; mockresult = new RegistrationDetailsViewModel { Uln = 1234567890, ProfileId = ProfileId, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }