public void UnattendedSetup_Should_Redirect_When_Installed_Is_True() { // Arrange _applicationSettings.Installed = true; // Act ActionResult result = _installController.Unattended("mock datastore", "fake connection string"); // Assert RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>(); redirectResult.AssertActionRouteIs("Index"); redirectResult.AssertControllerRouteIs("Home"); }
public void unattendedsetup_should_add_admin_user_and_set_default_site_settings() { // Arrange // Act ActionResult result = _installController.Unattended("mock datastore", "fake connection string"); // Assert ContentResult contentResult = result.AssertResultIs <ContentResult>(); Assert.That(contentResult.Content, Is.EqualTo("Unattended installation complete")); Assert.That(_installerRepository.AddAdminUserCalled, Is.True); Assert.That(_installerRepository.DatabaseName, Is.EqualTo("mock datastore")); Assert.That(_installerRepository.ConnectionString, Is.EqualTo("fake connection string")); ApplicationSettings appSettings = _configReaderWriter.ApplicationSettings; // check settings Assert.That(appSettings.UseObjectCache, Is.True); Assert.That(appSettings.UseBrowserCache, Is.True); SiteSettings settings = _installerRepository.SiteSettings; Assert.That(settings.AllowedFileTypes, Is.EqualTo("jpg,png,gif,zip,xml,pdf")); Assert.That(settings.MarkupType, Is.EqualTo("Creole")); Assert.That(settings.Theme, Is.EqualTo("Responsive")); Assert.That(settings.SiteName, Is.EqualTo("my site")); Assert.That(settings.SiteUrl, Is.EqualTo("http://localhost")); }