Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        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));
        }