public void finalize_should_set_publicsite_and_ignoresearcherrors_to_true()
        {
            // Arrange
            SettingsViewModel existingModel = new SettingsViewModel();

            // Act
            _installController.FinalizeInstall(existingModel);

            // Assert
            Assert.That(existingModel.IgnoreSearchIndexErrors, Is.True);
            Assert.That(existingModel.IsPublicSite, Is.True);
        }
        public void Finalize_Should_Set_PublicSite_And_IgnoreSearchErrors_To_True()
        {
            // Arrange
            SettingsViewModel existingModel = new SettingsViewModel();

            SetMockDataStoreType(existingModel);

            // Act
            _installController.FinalizeInstall(existingModel);

            // Assert
            Assert.That(existingModel.IgnoreSearchIndexErrors, Is.True);
            Assert.That(existingModel.IsPublicSite, Is.True);
        }
        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);
        }