public void ShouldMapHeadToDifferentControllerWithoutSubclassing() { var routes = new RouteCollection(); var mapper = new ResourceMapper<DifferentSuperclassController>(routes, new MvcRouteHandler()); mapper.MapHead(); Assert.That("HEAD /test", Routes.To( new {controller = "Restful", action = "Head", resourceUri = "Test", controllerType = typeof(DifferentSuperclassController)}, routes)); }
public void ShouldMapHeadToDifferentControllerWithoutSubclassing() { var routes = new RouteCollection(); var mapper = new ResourceMapper <DifferentSuperclassController>(routes, new MvcRouteHandler()); mapper.MapHead(); Assert.That("HEAD /test", Routes.To( new { controller = "Restful", action = "Head", resourceUri = "Test", controllerType = typeof(DifferentSuperclassController) }, routes)); }
public void ShouldMapHeadForAllResources() { var routes = new RouteCollection(); var mapper = new ResourceMapper<TestController>(routes, new MvcRouteHandler()); mapper.MapHead(); Assert.That("HEAD /test", Routes.To(new {controller = "Test", action = "Head", resourceUri = "Test"}, routes)); Assert.That("HEAD /test/1", Routes.To(new {controller = "Test", action = "Head", resourceUri = "Test/{id}"}, routes)); }
public void ShouldMapHeadForAllResources() { var routes = new RouteCollection(); var mapper = new ResourceMapper <TestController>(routes, new MvcRouteHandler()); mapper.MapHead(); Assert.That("HEAD /test", Routes.To(new { controller = "Test", action = "Head", resourceUri = "Test" }, routes)); Assert.That("HEAD /test/1", Routes.To(new { controller = "Test", action = "Head", resourceUri = "Test/{id}" }, routes)); }