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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public void CovidSearchRedirectIsEnabled()
 {
     ConfigurationManager.AppSettings["CovidSearchRedirectFlag"] = "true";
     Assert.True(FeatureRouter.CovidSearchRedirect(_queryString));
 }
예제 #4
0
 public void CovidSearchRedirectIsNotEnabledByQueryString()
 {
     _queryString["on2165"] = "false";
     Assert.False(FeatureRouter.CovidSearchRedirect(_queryString));
 }
예제 #5
0
 public void CovidSearchRedirectIsNullNotEnabled()
 {
     Assert.False(FeatureRouter.CovidSearchRedirect(_queryString));
 }