コード例 #1
0
ファイル: RouteAssert.cs プロジェクト: sanderd/MvcRouteTester
        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);
        }
コード例 #2
0
        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);
        }
コード例 #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);
        }
コード例 #4
0
 public static void HasApiRoute(HttpConfiguration config, string url, HttpMethod httpMethod, string body, IDictionary <string, string> expectedProps)
 {
     ApiRouteAssert.HasRoute(config, url, httpMethod, body, expectedProps);
 }
コード例 #5
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);
 }
コード例 #6
0
ファイル: RouteAssert.cs プロジェクト: sanderd/MvcRouteTester
        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);
        }
コード例 #7
0
ファイル: RouteAssert.cs プロジェクト: sanderd/MvcRouteTester
 /// <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);
 }