public async Task <ActionResult> FirstQuestion(string pathwayNumber, string gender, int age, string args) { if (FeatureRouter.CovidSearchRedirect(HttpContext.Request.Params) && pathwayNumber == GuidedSelectionPathwayNumber) { return(RedirectToAction("GuidedSelection", new RouteValueDictionary { { "gender", gender }, { "age", age }, { "args", args } })); } var model = BuildModel(pathwayNumber, gender, age, args); return(await JustToBeSafeFirst(model).ConfigureAwait(false)); }
public async Task <ActionResult> SearchResults(SearchJourneyViewModel model) { //Could combine these no results? if (!ModelState.IsValidField("SanitisedSearchTerm")) { return(NoResults(model)); } model.EntrySearchTerm = model.SanitisedSearchTerm; if (model.SanitisedSearchTerm == null) { return(NoResults(model)); } if (FeatureRouter.CovidSearchRedirect(HttpContext.Request.Params) && model.IsReservedCovidSearchTerm) { return(RedirectToGuidedSelection(model.SanitisedSearchTerm, model)); } //model.ViaGuidedSelection = false; return(await SearchResultsView(model).ConfigureAwait(false)); }
public void CovidSearchRedirectIsEnabled() { ConfigurationManager.AppSettings["CovidSearchRedirectFlag"] = "true"; Assert.True(FeatureRouter.CovidSearchRedirect(_queryString)); }
public void CovidSearchRedirectIsNotEnabledByQueryString() { _queryString["on2165"] = "false"; Assert.False(FeatureRouter.CovidSearchRedirect(_queryString)); }
public void CovidSearchRedirectIsNullNotEnabled() { Assert.False(FeatureRouter.CovidSearchRedirect(_queryString)); }