예제 #1
0
 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));
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        private static ServiceStackHandlerBase GetHandler(IHttpRequest httpReq)
        {
            var httpHandler = HttpHandlerFactory.GetHandlerForPathInfo(httpReq, null) as ServiceStackHandlerBase;

            if (httpHandler == null)
            {
                throw new NotSupportedException(httpReq.PathInfo);
            }
            return(httpHandler);
        }
예제 #4
0
 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));
     }
 }