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() { _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() { 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() { _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() { 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() { 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() { _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() { 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 = _providerUkprn.ToString(), SelectedProviderDisplayName = "Barnsley College (98765432)", ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Barnsley College (98765432)", Value = _providerUkprn.ToString() } } }; _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 } } }; _selectSpecialismViewModel = new SelectSpecialismViewModel { PathwaySpecialisms = _pathwaySpecialismsViewModel }; _academicYearViewModel = new SelectAcademicYearViewModel { SelectedAcademicYear = "2020" }; cacheResult = new RegistrationViewModel { Uln = _ulnViewModel, LearnersName = _learnersNameViewModel, DateofBirth = _dateofBirthViewModel, SelectProvider = _selectProviderViewModel, SelectCore = _selectCoreViewModel, SpecialismQuestion = _specialismQuestionViewModel, SelectSpecialisms = _selectSpecialismViewModel, SelectAcademicYear = _academicYearViewModel }; RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(Ukprn, _providerUkprn).Returns(_selectCoreViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }
public override void Given() { IsChangeMode = true; _reregisterProviderViewModel = new ReregisterProviderViewModel { SelectedProviderUkprn = _providerUkprn.ToString(), SelectedProviderDisplayName = "Barnsley College (98765432)", ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Barnsley College (98765432)", Value = _providerUkprn.ToString() } } }; _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = _coreCode, SelectedCoreDisplayName = $"Education ({_coreCode})", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _reregisterSpecialismQuestionViewModel = new ReregisterSpecialismQuestionViewModel { 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 } } }; _reregisterSpecialismViewModel = new ReregisterSpecialismViewModel { PathwaySpecialisms = _pathwaySpecialismsViewModel }; _academicYearViewModel = new ReregisterAcademicYearViewModel { SelectedAcademicYear = "2020" }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel, ReregisterCore = _reregisterCoreViewModel, SpecialismQuestion = _reregisterSpecialismQuestionViewModel, ReregisterSpecialisms = _reregisterSpecialismViewModel, ReregisterAcademicYear = _academicYearViewModel }; _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() { 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 = _providerUkprn.ToString(), SelectedProviderDisplayName = "Barnsley College (98765432)", ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Barnsley College (98765432)", Value = _providerUkprn.ToString() } } }; _selectCoreViewModel = new SelectCoreViewModel { SelectedCoreCode = "123", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = "123" } } }; cacheResult = new RegistrationViewModel { Uln = _ulnViewModel, LearnersName = _learnersNameViewModel, DateofBirth = _dateofBirthViewModel, SelectProvider = _selectProviderViewModel, SelectCore = _selectCoreViewModel }; RegistrationLoader.GetRegisteredProviderPathwayDetailsAsync(Ukprn, _providerUkprn).Returns(_selectCoreViewModel); CacheService.GetAsync <RegistrationViewModel>(CacheKey).Returns(cacheResult); }