public void RouterActionControllerResolveTest()
        {
            // assert
            var controllerContainer = new ControllerContainer()
                .RegisterController("home", () => new HomeController());

            var routerAction = new HttpControllerAction(controllerContainer)
            {
                HttpMethod = "GET",
                UriPath = "/home/index"
            };

            // act
            var actionContext = routerAction.GetExecutionContext();
            routerAction.GetActionResult(actionContext);

            // assert
            Assert.IsInstanceOf<HomeController>(actionContext.Controller);
        }
Ejemplo n.º 2
0
        public void RouterActionControllerResolveTest()
        {
            // assert
            var controllerContainer = new ControllerContainer()
                                      .RegisterController("home", () => new HomeController());

            var routerAction = new HttpControllerAction(controllerContainer)
            {
                HttpMethod = "GET",
                UriPath    = "/home/index"
            };

            // act
            var actionContext = routerAction.GetExecutionContext();

            routerAction.GetActionResult(actionContext);

            // assert
            Assert.IsInstanceOf <HomeController>(actionContext.Controller);
        }