public void Setup() { _commandExecutor = MockRepository.GenerateMock <ICommandExecutor>(); _messageManager = MockRepository.GenerateMock <IMessageManager>(); _referrerProvider = MockRepository.GenerateMock <IReferrerProvider>(); _controller = new DummyExecuteController(_commandExecutor, _messageManager, _referrerProvider); }
public void Setup() { _commandExecutor = MockRepository.GenerateMock<ICommandExecutor>(); _messageManager = MockRepository.GenerateMock<IMessageManager>(); _referrerProvider = MockRepository.GenerateMock<IReferrerProvider>(); _controller = new DummyExecuteController( _commandExecutor, _messageManager, _referrerProvider ); }
public BaseExecuteControllerTests() { _commandExecutorMock = new Mock <ICommandExecutor>(); _mappingEngineMock = new Mock <IViewModelToCommandMappingEngine>(); _messageManagerMock = new Mock <IMessageManager>(); _referrerProviderMock = new Mock <IReferrerProvider>(); _controller = ControllerInstantiater.Instantiate <DummyExecuteController>(_commandExecutorMock.Object, _mappingEngineMock.Object, _messageManagerMock.Object, _referrerProviderMock.Object); }
public BaseCommandControllerTests() { _mapperMock = new Mock <IViewModelToCommandMappingEngine>(); _commandExecutorMock = new Mock <ICommandExecutor>(); _messageManagerMock = new Mock <IMessageManager>(); _referrerProviderMock = new Mock <IReferrerProvider>(); _controller = ControllerInstantiater.Instantiate <DummyExecuteController>(_commandExecutorMock.Object, _mapperMock.Object, _messageManagerMock.Object, _referrerProviderMock.Object); var routeData = new RouteData(); routeData.Values.Add("controller", "DummyDeleteFile"); _controller.ControllerContext = new ControllerContext { RouteData = routeData }; }
public void Setup() { _mapper = MockRepository.GenerateMock<IViewModelToCommandMappingEngine>(); _mockedServiceLocator = MockRepository.GenerateMock<IServiceLocator>(); _mockedServiceLocator .Stub( x => x.GetInstance<IViewModelToCommandMappingEngine>() ) .Return( _mapper ); ServiceLocator.SetLocatorProvider( () => _mockedServiceLocator ); _commandExecutor = MockRepository.GenerateMock<ICommandExecutor>(); _messageManager = MockRepository.GenerateMock<IMessageManager>(); _referrerProvider = MockRepository.GenerateMock<IReferrerProvider>(); _controller = new DummyExecuteController( _commandExecutor, _messageManager, _referrerProvider ); var routeData = new RouteData(); routeData.Values.Add( "controller", "DummyDeleteFile" ); _controller.ControllerContext = new ControllerContext { RouteData = routeData }; }
public void Setup() { _mapper = MockRepository.GenerateMock <IViewModelToCommandMappingEngine>(); _mockedServiceLocator = MockRepository.GenerateMock <IServiceLocator>(); _mockedServiceLocator .Stub(x => x.GetInstance <IViewModelToCommandMappingEngine>()) .Return(_mapper); ServiceLocator.SetLocatorProvider(() => _mockedServiceLocator); _commandExecutor = MockRepository.GenerateMock <ICommandExecutor>(); _messageManager = MockRepository.GenerateMock <IMessageManager>(); _referrerProvider = MockRepository.GenerateMock <IReferrerProvider>(); _controller = new DummyExecuteController(_commandExecutor, _messageManager, _referrerProvider); var routeData = new RouteData(); routeData.Values.Add("controller", "DummyDeleteFile"); _controller.ControllerContext = new ControllerContext { RouteData = routeData }; }
public void HasSetAllDependencies() { var messageManager = MockRepository.GenerateMock<IMessageManager>(); var commandExecutor = MockRepository.GenerateMock<ICommandExecutor>(); var referrerProvider = MockRepository.GenerateMock<IReferrerProvider>(); var locator = MockRepository.GenerateMock<IServiceLocator>(); locator .Stub(x => x.GetInstance<ICommandExecutor>()) .Return(commandExecutor); locator .Stub( x => x.GetInstance<IMessageManager>() ) .Return( messageManager ); locator .Stub( x => x.GetInstance<IReferrerProvider>() ) .Return( referrerProvider ); ServiceLocator.SetLocatorProvider( () => locator ); var controller = new DummyExecuteController(); HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull( controller ); }
public void HasSetAllDependencies() { var messageManager = MockRepository.GenerateMock <IMessageManager>(); var commandExecutor = MockRepository.GenerateMock <ICommandExecutor>(); var referrerProvider = MockRepository.GenerateMock <IReferrerProvider>(); var locator = MockRepository.GenerateMock <IServiceLocator>(); locator .Stub(x => x.GetInstance <ICommandExecutor>()) .Return(commandExecutor); locator .Stub(x => x.GetInstance <IMessageManager>()) .Return(messageManager); locator .Stub(x => x.GetInstance <IReferrerProvider>()) .Return(referrerProvider); ServiceLocator.SetLocatorProvider(() => locator); var controller = new DummyExecuteController(); HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller); }