public void AreSpeakersInitialized() { HomeController controller = new HomeController(); ViewResult result = controller.Index() as ViewResult; Assert.IsNotNull(result.ViewBag.Speakers); }
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); }