public void Resolves_the_right_handler_for_expexted_paths() { foreach (var item in pathInfoMap) { var expectedType = item.Value; var handler = HttpHandlerFactory.GetHandlerForPathInfo(null, item.Key, null, null); Assert.That(handler.GetType(), Is.EqualTo(expectedType)); } }
private static ServiceStackHandlerBase GetHandler(string httpMethod, string pathInfo) { var httpHandler = HttpHandlerFactory.GetHandlerForPathInfo(httpMethod, pathInfo, pathInfo, null) as ServiceStackHandlerBase; if (httpHandler == null) { throw new NotSupportedException(pathInfo); } return(httpHandler); }
private static ServiceStackHandlerBase GetHandler(IHttpRequest httpReq) { var httpHandler = HttpHandlerFactory.GetHandlerForPathInfo(httpReq, null) as ServiceStackHandlerBase; if (httpHandler == null) { throw new NotSupportedException(httpReq.PathInfo); } return(httpHandler); }
public void Resolves_the_right_handler_for_case_insensitive_expexted_paths() { foreach (var item in pathInfoMap) { var expectedType = item.Value; var lowerPathInfo = item.Key.ToLower(); lowerPathInfo.Print(); var handler = HttpHandlerFactory.GetHandlerForPathInfo(null, lowerPathInfo, null, null); Assert.That(handler.GetType(), Is.EqualTo(expectedType)); } }