public void Resolves_the_right_handler_for_expexted_paths()
 {
     foreach (var item in pathInfoMap)
     {
         var expectedType = item.Value;
         var handler      = ServiceStackHttpHandlerFactory.GetHandlerForPathInfo(null, item.Key, null, null);
         Assert.That(handler.GetType(), Is.EqualTo(expectedType));
     }
 }
Exemplo n.º 2
0
        private static EndpointHandlerBase GetHandler(string httpMethod, string pathInfo)
        {
            var httpHandler = ServiceStackHttpHandlerFactory.GetHandlerForPathInfo(httpMethod, pathInfo, pathInfo, null) as EndpointHandlerBase;

            if (httpHandler == null)
            {
                throw new NotSupportedException(pathInfo);
            }
            return(httpHandler);
        }
Exemplo n.º 3
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();
         var handler       = ServiceStackHttpHandlerFactory.GetHandlerForPathInfo(null, lowerPathInfo);
         Assert.That(handler.GetType(), Is.EqualTo(expectedType));
     }
 }