public void Create_QueryParamsCollectionContainsEscaping_Ok() { string query = string.Format("?value={0}", HttpUtility.UrlEncode("one + two")); ObjectCreator creator = new ObjectCreator(typeof(SampleRequest)); NameValueCollection queryParams = HttpUtility.ParseQueryString(query); var result = creator.Create(queryParams); Assert.IsType<SampleRequest>(result); Assert.Equal("one + two", ((SampleRequest)result).Value); }
public object GetRequestValue(Type targetType) { ObjectCreator objectCreator = GetObjectCreator(targetType); return(objectCreator.Create(QueryParams)); }