Ejemplo n.º 1
0
        public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, Dictionary <string, string> headers, string body, BodyFormat bodyFormat, object expectations)
        {
            var propertyReader = new PropertyReader();
            var expectedProps  = propertyReader.RouteValues(expectations);

            ApiRouteAssert.HasRoute(config, url, httpMethod, headers, body, bodyFormat, expectedProps);
        }
        public void To <TController>(HttpMethod httpMethod, Expression <Action <TController> > action) where TController : ApiController
        {
            var expressionReader = new ExpressionReader();
            IDictionary <string, string> expectedProps = expressionReader.Read(action);

            ApiRouteAssert.HasRoute(Configuration, Url, httpMethod, requestBody, expectedProps);
        }
Ejemplo n.º 3
0
        public UrlAndHttpRoutes To <TController>(Dictionary <string, string> headers, Expression <Action <TController> > action) where TController : ApiController
        {
            var expressionReader = new ExpressionReader();
            var expectedProps    = expressionReader.Read(action);

            ApiRouteAssert.HasRoute(Configuration, Url, HttpMethod, headers, requestBody, bodyFormat, expectedProps);

            return(this);
        }
        public void ToNoMethod <TController>(HttpMethod httpMethod) where TController : ApiController
        {
            var controllerType = typeof(TController);

            ApiRouteAssert.RouteDoesNotHaveMethod(Configuration, Url, controllerType, httpMethod);
        }
 public void ToNoRoute()
 {
     ApiRouteAssert.NoRoute(Configuration, Url);
 }
Ejemplo n.º 6
0
 public void WithoutHandler()
 {
     ApiRouteAssert.HasNoHandler(Configuration, Url);
 }
Ejemplo n.º 7
0
 public void WithoutHandler <THandler>() where THandler : DelegatingHandler
 {
     ApiRouteAssert.HasNoHandlerofType <THandler>(Configuration, Url);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Asserts that an entry in the routing table is not found that matches this url
 /// </summary>
 public static void NoApiRouteMatches(HttpConfiguration config, string url)
 {
     ApiRouteAssert.NoRouteMatches(config, url);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Asserts that the API route for the url exists to the specified controller, but does not have the specified Http method.
 /// </summary>
 public static void ApiRouteDoesNotHaveMethod(HttpConfiguration config, string url, Type controllerType, HttpMethod httpMethod)
 {
     ApiRouteAssert.RouteDoesNotHaveMethod(config, url, controllerType, httpMethod);
 }
Ejemplo n.º 10
0
 public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, string body, IDictionary <string, string> expectedProps)
 {
     ApiRouteAssert.HasRoute(config, url, httpMethod, body, expectedProps);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Asserts that the API route exists, has the specified Http method
 /// </summary>
 public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod)
 {
     ApiRouteAssert.HasRoute(config, url, httpMethod);
 }
Ejemplo n.º 12
0
        public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, Dictionary <string, string> headers, string body, BodyFormat bodyFormat, IDictionary <string, string> expectedProps)
        {
            var expectedRouteValues = new RouteValues(expectedProps);

            ApiRouteAssert.HasRoute(config, url, httpMethod, headers, body, bodyFormat, expectedRouteValues);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Asserts that the API route exists, has the specified Http method
 /// </summary>
 public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, Dictionary <string, string> headers)
 {
     ApiRouteAssert.HasRoute(config, url, httpMethod, headers);
 }