Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
            public object GetRequestValue(Type targetType)
            {
                ObjectCreator objectCreator = GetObjectCreator(targetType);

                return(objectCreator.Create(QueryParams));
            }