/// <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, object expectations) { var propertyReader = new PropertyReader(); var expectedProps = propertyReader.Properties(expectations); HasApiRoute(config, url, httpMethod, expectedProps); }
/// <summary> /// Asserts that the route exists and meets expectations /// </summary> public static void HasRoute(RouteCollection routes, string url, object expectations) { var propertyReader = new PropertyReader(); var expectedProps = propertyReader.Properties(expectations); HasRoute(routes, url, expectedProps); }
private static void ProcessActionParam(HttpParameterDescriptor param, HttpRouteData routeDataValues, Dictionary<string, string> result) { var propertyReader = new PropertyReader(); if (propertyReader.IsSimpleType(param.ParameterType)) { var paramName = param.ParameterName; AddParamWithRouteValue(paramName, routeDataValues.Values, result); } else { var fieldNames = propertyReader.SimplePropertyNames(param.ParameterType); foreach (var fieldName in fieldNames) { AddParamWithRouteValue(fieldName.ToLowerInvariant(), routeDataValues.Values, result); } } }