public void HasSetAllDependencies()
        {
            var viewModelFactory = new Mock <IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument> >();
            var locator          = new Mock <IServiceProvider>();

            locator
            .Setup(x => x.GetService(typeof(IViewModelFactory <DummyReadViewModel, DummyReadViewModelProviderArgument>)))
            .Returns(viewModelFactory);

            var controller = ControllerInstantiater.Instantiate <DummyReadController>(_viewModelFactoryMock.Object);

            HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller);
        }
        public void HasSetAllDependencies()
        {
            var commandExecutor = new Mock <ICommandExecutor>();

            var locator = new Mock <IServiceProvider>();

            locator
            .Setup(x => x.GetService(typeof(ICommandExecutor)))
            .Returns(commandExecutor);

            var controller = ControllerInstantiater.Instantiate <DummyCommandController>(_commandExecutorMock.Object, _mapperMock.Object);

            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);
        }
        public void HasSetAllDependencies()
        {
            var commandExecutor = MockRepository.GenerateMock <ICommandExecutor>();

            var locator = MockRepository.GenerateMock <IServiceLocator>();

            locator
            .Stub(x => x.GetInstance <ICommandExecutor>())
            .Return(commandExecutor);

            ServiceLocator.SetLocatorProvider(() => locator);
            var controller = new DummyCommandController();

            HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller);
        }
Exemple #5
0
        public void HasSetAllDependencies()
        {
            var viewModelFactory = new Mock <IViewModelFactory <DummyReadExecuteViewModel, DummyReadExecuteViewModelArgs> >();
            var commandExecutor  = new Mock <ICommandExecutor>();
            var locator          = new Mock <IServiceProvider>();

            locator
            .Setup(x => x.GetService(typeof(IViewModelFactory <DummyReadExecuteViewModel, DummyReadExecuteViewModelArgs>)))
            .Returns(viewModelFactory);

            locator
            .Setup(x => x.GetService(typeof(ICommandExecutor)))
            .Returns(commandExecutor);

            var controller = ControllerInstantiater.Instantiate <DummyReadExecuteController>(_commandExecutor.Object, _mapperMock.Object, viewModelFactory.Object);

            HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller);
        }
Exemple #6
0
        public void HasSetAllDependencies()
        {
            var messageManager   = new Mock <IMessageManager>();
            var commandExecutor  = new Mock <ICommandExecutor>();
            var referrerProvider = new Mock <IReferrerProvider>();

            var locator = new Mock <IServiceProvider>();

            locator
            .Setup(x => x.GetService(typeof(ICommandExecutor)))
            .Returns(commandExecutor);
            locator
            .Setup(x => x.GetService(typeof(IMessageManager)))
            .Returns(messageManager);
            locator
            .Setup(x => x.GetService(typeof(IReferrerProvider)))
            .Returns(referrerProvider);

            var controller = ControllerInstantiater.Instantiate <DummyExecuteController>(commandExecutor.Object, _mappingEngineMock.Object, messageManager.Object, referrerProvider.Object);

            HasSetAllDependenciesControllerHelper.AssertFieldsAreNotNull(controller);
        }