コード例 #1
0
        public void AreSpeakersInitialized()
        {
            HomeController controller = new HomeController();

            ViewResult result = controller.Index() as ViewResult;

            Assert.IsNotNull(result.ViewBag.Speakers);
        }
コード例 #2
0
        public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
        {
            if (controllerName.ToLower().StartsWith("home"))
            {
                ISpeakerService service = new SpeakersRepository();
                IController controller = new HomeController(service);

                return controller;
            }

            IControllerFactory factory = new DefaultControllerFactory();
            return factory.CreateController(requestContext, controllerName);
        }