public static EmployerNameOption ConvertToDomainOption(this EmployerIdentityOption model) { switch (model) { case EmployerIdentityOption.RegisteredName: return(EmployerNameOption.RegisteredName); case EmployerIdentityOption.ExistingTradingName: return(EmployerNameOption.TradingName); case EmployerIdentityOption.NewTradingName: return(EmployerNameOption.TradingName); case EmployerIdentityOption.Anonymous: return(EmployerNameOption.Anonymous); default: throw new ArgumentException($"Cannot map '{model.ToString()}' to '{nameof(EmployerNameOption)}'"); } }
public async Task WhenEmployerNameOptionUpdated_ShouldFlagEmployerNameFieldIndicator(EmployerNameOption employerNameOption, EmployerIdentityOption employerIdentityOption, string newTradingName, bool shouldFlagIndicator) { _fixture .WithEmployerNameOption(employerNameOption) .WithTradingName(employerNameOption == EmployerNameOption.TradingName ? "this is a value" : null) .Setup(); var locationEditModel = new LocationEditModel { EmployerAccountId = _fixture.Vacancy.EmployerAccountId, VacancyId = _fixture.Vacancy.Id, SelectedLocation = LocationViewModel.UseOtherLocationConst }; await _fixture.PostLocationEditModelAsync(locationEditModel, new VacancyEmployerInfoModel { EmployerIdentityOption = employerIdentityOption, NewTradingName = newTradingName, AccountLegalEntityPublicHashedId = _fixture.Vacancy.AccountLegalEntityPublicHashedId }); _fixture.VerifyEmployerReviewFieldIndicators(FieldIdentifiers.EmployerName, shouldFlagIndicator); }