public void AddFilterParamsToUrl(NciUrl url, string filterParams, NciUrl expectedUrl) { NameValueCollection coll = HttpUtility.ParseQueryString(filterParams); TrialListingQueryHelper.AddFilterParamsToUrl(url, coll); Assert.Equal(expectedUrl, url, new NciUrlComparer()); }
/// <summary> /// Gets URL for a Single Page of Results /// </summary> /// <param name="pageNum"></param> /// <returns></returns> public string GetPageUrl(int pageNum) { NciUrl url = this.PageInstruction.GetUrl("CurrentURL"); if (!url.QueryParameters.ContainsKey(PAGENUM_PARAM)) { url.QueryParameters.Add(PAGENUM_PARAM, pageNum.ToString()); } else { url.QueryParameters[PAGENUM_PARAM] = pageNum.ToString(); } //TODO: What about items per page? //TODO: Why are the filters not part of the URL already? //Add the filters back into the URL TrialListingQueryHelper.AddFilterParamsToUrl(url, HttpContext.Current.Request.QueryString); return(url.ToString()); }