public void RegisterController_DummyController_IsRegisteredInStore() { var initializer = new DummyInitializer(); var controller = typeof(DummyController); using (new ObjectFactoryContainerRegion()) { ObjectFactory.Container.RegisterType <ConfigManager, ConfigManager>(typeof(XmlConfigProvider).Name.ToUpperInvariant(), new InjectionConstructor(typeof(XmlConfigProvider).Name)); ObjectFactory.Container.RegisterType <XmlConfigProvider, DummyConfigProvider>(); Config.RegisterSection <ResourcesConfig>(); Config.RegisterSection <ProjectConfig>(); initializer.RegisterControllerPublic(controller); var resourceRegistered = ObjectFactory.Container.IsRegistered(typeof(DummyControllerResoruces), Res.GetResourceClassId(typeof(DummyControllerResoruces))); Assert.IsTrue(resourceRegistered, "String resources were not registered for the controller."); } var registration = ControllerStore.Controllers().SingleOrDefault(c => c.ControllerType == controller); Assert.IsNotNull(registration, "Controller was not registered."); var route = RouteTable.Routes[controller.Name]; Assert.IsNull(route, "Route was registered for the controller."); }
public void RegisterController_DesignerController_NotRegistersAnylRoutes() { var initializer = new DummyInitializer(); var controller = typeof(DesignerController); using (new ObjectFactoryContainerRegion()) { ObjectFactory.Container.RegisterType <ConfigManager, ConfigManager>(typeof(XmlConfigProvider).Name.ToUpperInvariant(), new InjectionConstructor(typeof(XmlConfigProvider).Name)); ObjectFactory.Container.RegisterType <XmlConfigProvider, DummyConfigProvider>(); initializer.RegisterControllerPublic(controller); } var registration = ControllerStore.Controllers().SingleOrDefault(c => c.ControllerType == controller); Assert.IsNotNull(registration, "DesignerController was not registered."); var route = RouteTable.Routes[controller.Name]; Assert.IsNull(route, "Route was registered for the controller."); }
public void RegisterController_DummyController_IsRegisteredInStore() { var initializer = new DummyInitializer(); var controller = typeof(DummyController); using (new ObjectFactoryContainerRegion()) { ObjectFactory.Container.RegisterType<ConfigManager, ConfigManager>(typeof(XmlConfigProvider).Name.ToUpperInvariant(), new InjectionConstructor(typeof(XmlConfigProvider).Name)); ObjectFactory.Container.RegisterType<XmlConfigProvider, DummyConfigProvider>(); Config.RegisterSection<ResourcesConfig>(); Config.RegisterSection<ProjectConfig>(); initializer.RegisterControllerPublic(controller); var resourceRegistered = ObjectFactory.Container.IsRegistered(typeof(DummyControllerResoruces), Res.GetResourceClassId(typeof(DummyControllerResoruces))); Assert.IsTrue(resourceRegistered, "String resources were not registered for the controller."); } var registration = ControllerStore.Controllers().SingleOrDefault(c => c.ControllerType == controller); Assert.IsNotNull(registration, "Controller was not registered."); var route = RouteTable.Routes[controller.Name]; Assert.IsNull(route, "Route was registered for the controller."); }
public void RegisterController_DesignerController_NotRegistersAnylRoutes() { var initializer = new DummyInitializer(); var controller = typeof(DesignerController); using (new ObjectFactoryContainerRegion()) { ObjectFactory.Container.RegisterType<ConfigManager, ConfigManager>(typeof(XmlConfigProvider).Name.ToUpperInvariant(), new InjectionConstructor(typeof(XmlConfigProvider).Name)); ObjectFactory.Container.RegisterType<XmlConfigProvider, DummyConfigProvider>(); initializer.RegisterControllerPublic(controller); } var registration = ControllerStore.Controllers().SingleOrDefault(c => c.ControllerType == controller); Assert.IsNotNull(registration, "DesignerController was not registered."); var route = RouteTable.Routes[controller.Name]; Assert.IsNull(route, "Route was registered for the controller."); }