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() { // 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() { 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() { 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() { 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 { 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() { _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = _coreCode, CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _reregisterSpecialismQuestionViewModel = new ReregisterSpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true }; _registrationDetailViewModel = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; cacheResult = new ReregisterViewModel { ReregisterCore = _reregisterCoreViewModel, SpecialismQuestion = _reregisterSpecialismQuestionViewModel }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayName = "Test Pathway", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = "345678", Name = "Test Specialism", DisplayName = "Test Specialism (345678)" } } }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
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() { IsFromCoreDenialPage = true; mockresult = new RegistrationDetailsViewModel { Uln = 1234567890, ProfileId = ProfileId, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { WithdrawBackLinkOption = WithdrawBackLinkOptions.CannotChangeProviderAndCorePage; mockresult = new RegistrationDetailsViewModel { Uln = 1234567890, ProfileId = ProfileId, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(mockresult); }
public RegistrationDetailsViewModel Map(RegistrationViewModel model) { var viewModel = new RegistrationDetailsViewModel(); viewModel.FirstName = model.FirstName; viewModel.LastName = model.LastName; viewModel.Username = model.Username; viewModel.PhoneNumber = model.PhoneNumber; viewModel.EmailAddress = model.EmailAddress; viewModel.Password = model.Password; return(viewModel); }
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() { _routeAttributes = new Dictionary <string, string> { { Constants.ProfileId, ProfileId.ToString() }, { Constants.IsChangeMode, "true" } }; _reregisterProviderViewModel = new ReregisterProviderViewModel { SelectedProviderUkprn = "98765432", SelectedProviderDisplayName = "Barnsley College (98765432)" }; _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 { ProfileId = ProfileId, SelectedAcademicYear = "2020" }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel, ReregisterCore = _reregisterCoreViewModel, SpecialismQuestion = _reregisterSpecialismQuestionViewModel, ReregisterSpecialisms = _reregisterSpecialismViewModel, ReregisterAcademicYear = _academicYearViewModel }; _registrationDetails = new RegistrationDetailsViewModel { ProfileId = 1, Uln = _uln, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(_registrationDetails); CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
public async Task <IActionResult> Delete(int?id, string returnUrl) { if (id == null || !RegistrationExists((int)id)) { return(NotFound()); } Registration r = await _registrationService.Registrations.GetRegistrationWithUserAndEventByRegistrationIdAsync((int)id); RegistrationDetailsViewModel vm = new RegistrationDetailsViewModel(r); ViewData["ActiveMenu"] = "Admin"; ViewData["ActiveLink"] = "RegistrationDelete"; ViewData["Title"] = "Delete Registration?"; ViewBag.ReturnUrl = returnUrl; return(View(vm)); }
public override void Given() { // input variance. var isChangeFromSplQuest = true; IsChangeMode = true; _registrationDetailsViewModel = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = _coreCode, CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _reregisterSpecialismQuestionViewModel = new ReregisterSpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true, IsChangeMode = isChangeFromSplQuest }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayName = "Test Pathway", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Id = 1, Code = _selectedSpecialismCode, Name = "Test Specialism", DisplayName = "Test Specialism (345678)", IsSelected = true } } }; cacheResult = new ReregisterViewModel { ReregisterProvider = new ReregisterProviderViewModel(), ReregisterCore = _reregisterCoreViewModel, SpecialismQuestion = _reregisterSpecialismQuestionViewModel, ReregisterSpecialisms = new ReregisterSpecialismViewModel { SelectedSpecialismCode = _selectedSpecialismCode, PathwaySpecialisms = _pathwaySpecialismsViewModel }, ReregisterAcademicYear = new ReregisterAcademicYearViewModel() }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(_registrationDetailsViewModel); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Status = _registrationPathwayStatus }; cacheResult = new ReregisterViewModel { ReregisterCore = new ReregisterCoreViewModel { CoreCodeAtTheTimeOfWithdrawn = "999", SelectedCoreCode = "123" } }; CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = ProfileId, Status = _registrationPathwayStatus }; _selectProviderViewModel = new SelectProviderViewModel { ProvidersSelectList = new List <SelectListItem> { new SelectListItem { Text = "Hello", Value = "1" } } }; RegistrationLoader.GetRegisteredTqAoProviderDetailsAsync(AoUkprn).Returns(_selectProviderViewModel); RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, _registrationPathwayStatus).Returns(mockresult); }
public override void Given() { mockresult = new RegistrationDetailsViewModel { ProfileId = 1, Uln = 1234567890, Name = "Test", DateofBirth = DateTime.UtcNow, ProviderDisplayName = "Test Provider (1234567)", PathwayDisplayName = "Pathway (7654321)", SpecialismsDisplayName = new List <string> { "Specialism1 (2345678)", "Specialism2 (555678)" }, AcademicYear = 2020, Status = RegistrationPathwayStatus.Withdrawn }; _routeAttributes = new Dictionary <string, string> { { Constants.ProfileId, mockresult.ProfileId.ToString() } }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId).Returns(mockresult); }
public async override Task When() { ActualResult = await Loader.GetRegistrationDetailsAsync(AoUkprn, ProfileId); }