/// <summary> /// Resets the state (only used from test cases) /// </summary> public void ResetState() { configuration = null; mrContainer = null; urlTokenizer = null; engineContextFactory = null; serviceProviderLocator = null; controllerFactory = null; controllerContextFactory = null; staticResourceRegistry = null; }
public void ResetState() { _Configuration = null; _MonoRailContainer = null; _UrlTokenizer = null; _EngineContextFactory = null; _ServiceProviderLocator = null; _ControllerFactory = null; _ControllerContextFactory = null; _StaticResourceRegistry = null; }
public void Init() { _Container = _MockRepository.CreateMock<IMonoRailContainer>(); _ServiceProviderLocatorMock = _MockRepository.CreateMock<IServiceProviderLocator>(); _ControllerFactoryMock = _MockRepository.CreateMock<IControllerFactory>(); _ControllerMock = _MockRepository.CreateMock<IController>(); _ControllerDescriptorProviderMock = _MockRepository.CreateMock<IControllerDescriptorProvider>(); _ControllerContextFactoryMock = _MockRepository.CreateMock<IControllerContextFactory>(); SetupResult.For( _Container.UrlTokenizer ).Return( new DefaultUrlTokenizer() ); SetupResult.For( _Container.UrlBuilder ).Return( new DefaultUrlBuilder() ); SetupResult.For( _Container.EngineContextFactory ).Return( new DefaultEngineContextFactory() ); SetupResult.For( _Container.ControllerFactory ).Return( _ControllerFactoryMock ); SetupResult.For( _Container.ControllerContextFactory ).Return( _ControllerContextFactoryMock ); SetupResult.For( _Container.ControllerDescriptorProvider ).Return( _ControllerDescriptorProviderMock ); SetupResult.For( _Container.StaticResourceRegistry ).Return( new DefaultStaticResourceRegistry() ); _HandlerFactory = new MonoRailHttpHandlerFactory( _ServiceProviderLocatorMock ); _HandlerFactory.ResetState(); _HandlerFactory.Configuration = new MonoRailConfiguration(); _HandlerFactory.Container = _Container; }
public void Init() { container = mockRepository.DynamicMock<IMonoRailContainer>(); serviceProviderLocatorMock = mockRepository.DynamicMock<IServiceProviderLocator>(); controllerFactoryMock = mockRepository.DynamicMock<IControllerFactory>(); controllerMock = mockRepository.DynamicMock<IAsyncController>(); controllerDescriptorProviderMock = mockRepository.DynamicMock<IControllerDescriptorProvider>(); controllerContextFactoryMock = mockRepository.DynamicMock<IControllerContextFactory>(); SetupResult.For(container.UrlTokenizer).Return(new DefaultUrlTokenizer()); SetupResult.For(container.UrlBuilder).Return(new DefaultUrlBuilder()); SetupResult.For(container.EngineContextFactory).Return(new DefaultEngineContextFactory()); SetupResult.For(container.ControllerFactory).Return(controllerFactoryMock); SetupResult.For(container.ControllerContextFactory).Return(controllerContextFactoryMock); SetupResult.For(container.ControllerDescriptorProvider).Return(controllerDescriptorProviderMock); SetupResult.For(container.StaticResourceRegistry).Return(new DefaultStaticResourceRegistry()); handlerFactory = new MonoRailHttpHandlerFactory(serviceProviderLocatorMock); handlerFactory.ResetState(); handlerFactory.Configuration = new MonoRailConfiguration(); handlerFactory.Container = container; }
public void Init() { container = mockRepository.DynamicMock <IMonoRailContainer>(); serviceProviderLocatorMock = mockRepository.DynamicMock <IServiceProviderLocator>(); controllerFactoryMock = mockRepository.DynamicMock <IControllerFactory>(); controllerMock = mockRepository.DynamicMock <IAsyncController>(); controllerDescriptorProviderMock = mockRepository.DynamicMock <IControllerDescriptorProvider>(); controllerContextFactoryMock = mockRepository.DynamicMock <IControllerContextFactory>(); SetupResult.For(container.UrlTokenizer).Return(new DefaultUrlTokenizer()); SetupResult.For(container.UrlBuilder).Return(new DefaultUrlBuilder()); SetupResult.For(container.EngineContextFactory).Return(new DefaultEngineContextFactory()); SetupResult.For(container.ControllerFactory).Return(controllerFactoryMock); SetupResult.For(container.ControllerContextFactory).Return(controllerContextFactoryMock); SetupResult.For(container.ControllerDescriptorProvider).Return(controllerDescriptorProviderMock); SetupResult.For(container.StaticResourceRegistry).Return(new DefaultStaticResourceRegistry()); handlerFactory = new MonoRailHttpHandlerFactory(serviceProviderLocatorMock); handlerFactory.ResetState(); handlerFactory.Configuration = new MonoRailConfiguration(); handlerFactory.Container = container; }
public void Init() { _Container = _MockRepository.CreateMock <IMonoRailContainer>(); _ServiceProviderLocatorMock = _MockRepository.CreateMock <IServiceProviderLocator>(); _ControllerFactoryMock = _MockRepository.CreateMock <IControllerFactory>(); _ControllerMock = _MockRepository.CreateMock <IController>(); _ControllerDescriptorProviderMock = _MockRepository.CreateMock <IControllerDescriptorProvider>(); _ControllerContextFactoryMock = _MockRepository.CreateMock <IControllerContextFactory>(); SetupResult.For(_Container.UrlTokenizer).Return(new DefaultUrlTokenizer()); SetupResult.For(_Container.UrlBuilder).Return(new DefaultUrlBuilder()); SetupResult.For(_Container.EngineContextFactory).Return(new DefaultEngineContextFactory()); SetupResult.For(_Container.ControllerFactory).Return(_ControllerFactoryMock); SetupResult.For(_Container.ControllerContextFactory).Return(_ControllerContextFactoryMock); SetupResult.For(_Container.ControllerDescriptorProvider).Return(_ControllerDescriptorProviderMock); SetupResult.For(_Container.StaticResourceRegistry).Return(new DefaultStaticResourceRegistry()); _HandlerFactory = new MonoRailHttpHandlerFactory(_ServiceProviderLocatorMock); _HandlerFactory.ResetState(); _HandlerFactory.Configuration = new MonoRailConfiguration(); _HandlerFactory.Container = _Container; }
void EnsureServices() { if (_UrlTokenizer == null) { _UrlTokenizer = _MonoRailContainer.UrlTokenizer; } if (_EngineContextFactory == null) { _EngineContextFactory = _MonoRailContainer.EngineContextFactory; } if (_ControllerFactory == null) { _ControllerFactory = _MonoRailContainer.ControllerFactory; } if (_ControllerContextFactory == null) { _ControllerContextFactory = _MonoRailContainer.ControllerContextFactory; } if (_StaticResourceRegistry == null) { _StaticResourceRegistry = _MonoRailContainer.StaticResourceRegistryEx; } }
private void EnsureServices() { if (urlTokenizer == null) { urlTokenizer = mrContainer.UrlTokenizer; } if (engineContextFactory == null) { engineContextFactory = mrContainer.EngineContextFactory; } if (controllerFactory == null) { controllerFactory = mrContainer.ControllerFactory; } if (controllerContextFactory == null) { controllerContextFactory = mrContainer.ControllerContextFactory; } if (staticResourceRegistry == null) { staticResourceRegistry = mrContainer.StaticResourceRegistry; } }
void EnsureServices() { if ( _UrlTokenizer == null ) { _UrlTokenizer = _MonoRailContainer.UrlTokenizer; } if ( _EngineContextFactory == null ) { _EngineContextFactory = _MonoRailContainer.EngineContextFactory; } if ( _ControllerFactory == null ) { _ControllerFactory = _MonoRailContainer.ControllerFactory; } if ( _ControllerContextFactory == null ) { _ControllerContextFactory = _MonoRailContainer.ControllerContextFactory; } if ( _StaticResourceRegistry == null ) { _StaticResourceRegistry = _MonoRailContainer.StaticResourceRegistryEx; } }