Exemplo n.º 1
0
		public void Setup()
		{
			_container = new MocksAndStubsContainer();

			_applicationSettings = _container.ApplicationSettings;
			_applicationSettings.Installed = false;

			_settingsService = _container.SettingsService;
			_userService = _container.UserService;
			_configReaderWriter = _container.ConfigReaderWriter;
			_repositoryFactory = _container.RepositoryFactory;
			_installationService = _container.InstallationService;
			_databaseTester = _container.DatabaseTester;
			_installerRepository = _container.InstallerRepository;

            _installController = new InstallController(_applicationSettings, _configReaderWriter, _installationService, _databaseTester);
		}
Exemplo n.º 2
0
		public void Setup()
		{
			_container = new MocksAndStubsContainer();

			_applicationSettings = _container.ApplicationSettings;
			_applicationSettings.Installed = false;

			_context = _container.UserContext;
			_repository = _container.Repository;
			_pluginFactory = _container.PluginFactory;
			_settingsService = _container.SettingsService;
			_userService = _container.UserService;
			_historyService = _container.HistoryService;
			_pageService = _container.PageService;
			_searchService = _container.SearchService;
			_configReaderWriter = new ConfigReaderWriterStub();

			_installController = new InstallController(_applicationSettings, _userService, _pageService, _searchService, _repository, _settingsService, _context, _configReaderWriter);
		}
Exemplo n.º 3
0
		public void finalize_should_install_and_save_site_settings()
		{
			// Arrange
			var model = new SettingsViewModel();
			model.AdminEmail = "email";
			model.AdminPassword = "******";
			model.Theme = "ConcupiscentGoatOnHolidayTheme";

			var installationServiceMock = new Mock<IInstallationService>();
			_installController = new InstallController(_applicationSettings, _configReaderWriter, installationServiceMock.Object, _databaseTester);

			// Act
			_installController.FinalizeInstall(model);

			// Assert
			Assert.That(model.IgnoreSearchIndexErrors, Is.True);
			Assert.That(model.IsPublicSite, Is.True);

			installationServiceMock.Verify(service => service.Install(model));

			Assert.That(_configReaderWriter.Saved, Is.True);
		}