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); }
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); }
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); }
/// <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); }