Exemplo n.º 1
0
        public static void GeneratesActionUrl(RouteCollection routes,
            string expectedUrl, object fromProps,
            HttpMethod httpMethod = null, string appPath = "/", string requestBody = null)
        {
            if (httpMethod == null)
            {
                httpMethod = HttpMethod.Get;
            }

            var propertyReader = new PropertyReader();
            var expectedRouteValues = propertyReader.RouteValues(fromProps);

            WebRouteAssert.GeneratesActionUrl(routes, httpMethod, expectedUrl, expectedRouteValues, appPath, requestBody);
        }
Exemplo n.º 2
0
        public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, string body, BodyFormat bodyFormat, object expectations)
        {
            var propertyReader = new PropertyReader();
            var expectedProps = propertyReader.RouteValues(expectations);

            ApiRouteAssert.HasRoute(config, url, httpMethod, body, bodyFormat, expectedProps);
        }
Exemplo n.º 3
0
 public static void HasRoute(RouteCollection routes, string url, string body, BodyFormat bodyFormat, object expectations)
 {
     var propertyReader = new PropertyReader();
     var expectedRouteValues = propertyReader.RouteValues(expectations);
     WebRouteAssert.HasRoute(routes, HttpMethod.Get, url, body, bodyFormat, expectedRouteValues);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Asserts that the API route exists, has the specified Http method and meets the expectations
        /// </summary>
        public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, Dictionary<string, string> headers,  object expectations)
        {
            var propertyReader = new PropertyReader();
            var expectedProps = propertyReader.RouteValues(expectations);

            ApiRouteAssert.HasRoute(config, url, httpMethod, headers, string.Empty, BodyFormat.None, expectedProps);
        }