Example #1
0
 public void Can_Register_Routes_Using_Add_Extension()
 {
     var routes = new ServiceRoutes();
     routes.Add<Customer>(HttpMethod.Get, "/Users/{0}/Orders/{1}", x => x.Name, x => x.OrderId);
     var route = routes.RestPaths[0];
     Assert.That(route.Path == "/Users/{Name}/Orders/{OrderId}");
 }
Example #2
0
 public void Can_Register_Routes_Using_Add_Extension()
 {
     var routes = new ServiceRoutes(appHost);
     routes.Add<Customer>("/Users/{0}/Orders/{1}", ApplyTo.Get, x => x.Name, x => x.OrderId);
     var route = appHost.RestPaths[0];
     Assert.That(route.Path == "/Users/{Name}/Orders/{OrderId}");
 }
        public void Can_Register_Routes_Using_Add_Extension()
        {
            var routes = new ServiceRoutes();

            routes.Add <Customer>(HttpMethod.Get, "/Users/{0}/Orders/{1}", x => x.Name, x => x.OrderId);
            var route = routes.RestPaths[0];

            Assert.That(route.Path == "/Users/{Name}/Orders/{OrderId}");
        }
Example #4
0
        public void Can_Register_Routes_Using_Add_Extension()
        {
            var routes = new ServiceRoutes();

            routes.Add <Customer>("/Users/{0}/Orders/{1}", ApplyTo.Get, x => x.Name, x => x.OrderId);
            var route = routes.Last();

            Assert.That(route.Path, Is.EqualTo("/Users/{Name}/Orders/{OrderId}"));
        }
Example #5
0
 public void Can_Register_Routes_Using_Add_Extension()
 {
     var routes = new ServiceRoutes(appHost);
     routes.Add<Customer>("/Users/{0}/Orders/{1}", ApplyTo.Get, x => x.Name, x => x.OrderId);
     var route = appHost.RestPaths.Last();
     Assert.That(route.Path, Is.EqualTo("/Users/{Name}/Orders/{OrderId}"));
 }