public BaseReadControllerTests() { _viewModelFactoryMock = new Mock <IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument> >(); _controller = ControllerInstantiater.Instantiate <DummyReadController>(_viewModelFactoryMock.Object); var routeData = new RouteData(); routeData.Values.Add("controller", "DummyDeleteFile"); _controller.ControllerContext.RouteData = routeData; _controller.TempData = new TempDataDictionary(_controller.HttpContext, new Mock <ITempDataProvider>().Object); }
public void Setup() { _viewModelFactory = MockRepository.GenerateMock<IViewModelFactory<DummyReadViewModel, DummyReadViewModelProviderArgument>>(); _controller = new DummyReadController( _viewModelFactory ); var routeData = new RouteData(); routeData.Values.Add( "controller", "DummyDeleteFile" ); _controller.ControllerContext = new ControllerContext { RouteData = routeData }; }
public void Setup() { _viewModelFactory = MockRepository.GenerateMock <IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument> >(); _controller = new DummyReadController(_viewModelFactory); var routeData = new RouteData(); routeData.Values.Add("controller", "DummyDeleteFile"); _controller.ControllerContext = new ControllerContext { RouteData = routeData }; }
public void HasSetAllDependencies() { var viewModelFactory = MockRepository.GenerateMock<IViewModelFactory<DummyReadViewModel, DummyReadViewModelProviderArgument>>(); var locator = MockRepository.GenerateMock<IServiceLocator>(); locator .Stub( x => x.GetInstance<IViewModelFactory<DummyReadViewModel, DummyReadViewModelProviderArgument>>() ) .Return( viewModelFactory ); ServiceLocator.SetLocatorProvider( () => locator ); var controller = new DummyReadController(); HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull( controller ); }
public void HasSetAllDependencies() { var viewModelFactory = MockRepository.GenerateMock <IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument> >(); var locator = MockRepository.GenerateMock <IServiceLocator>(); locator .Stub(x => x.GetInstance <IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument> >()) .Return(viewModelFactory); ServiceLocator.SetLocatorProvider(() => locator); var controller = new DummyReadController(); HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller); }