Ejemplo n.º 1
0
        public void Prefer_user_defined_routes_first()
        {
            using (var appHost = new BasicAppHost
            {
                ConfigureAppHost = host =>
                {
                    host.Routes.AddFromAssembly(typeof(RoutePriorityTests).GetAssembly());
                },
            }.Init())
            {
                var emptyUrl = new RoutePriority().ToGetUrl();
                Assert.That(emptyUrl, Is.EqualTo("/category/priority"));

                var autoRouteWithIdUrl = new RoutePriority { Id = "foo" }.ToGetUrl();
                Assert.That(autoRouteWithIdUrl, Is.EqualTo("/RoutePriority/foo"));
            }
        }
Ejemplo n.º 2
0
        public void Prefer_user_defined_routes_first()
        {
            using (var appHost = new BasicAppHost
            {
                ConfigureAppHost = host =>
                {
                    host.Routes.AddFromAssembly(typeof(RoutePriorityTests).Assembly);
                },
            }.Init())
            {
                var emptyUrl = new RoutePriority().ToGetUrl();
                Assert.That(emptyUrl, Is.EqualTo("/category/priority"));

                var autoRouteWithIdUrl = new RoutePriority {
                    Id = "foo"
                }.ToGetUrl();
                Assert.That(autoRouteWithIdUrl, Is.EqualTo("/RoutePriority/foo"));
            }
        }
Ejemplo n.º 3
0
 protected virtual object Run(RoutePriority request, ApplyTo method)
 {
     return(request.AsTypeString());
 }
Ejemplo n.º 4
0
 public object Post(RoutePriority request)
 {
     return(Run(request, ApplyTo.Post));
 }
Ejemplo n.º 5
0
 protected virtual object Run(RoutePriority request, ApplyTo method)
 {
     return request.AsTypeString();
 }
Ejemplo n.º 6
0
 public object Post(RoutePriority request)
 {
     return Run(request, ApplyTo.Post);
 }
Ejemplo n.º 7
0
 public object Get(RoutePriority request)
 {
     return Run(request, ApplyTo.Get);
 }