public async Task DifferentVersions_UpgradeIsCompleted() { migrationRunnerService.Execute(Arg.Any <SemVersion>(), Arg.Any <SemVersion>()).Returns(true); var anyStringArg = Arg.Any <string>(); settings.TryGetSiteRootDirectory(out anyStringArg).Returns( x => { x[0] = @"C:\test\umbraco"; return(true); }); var xmlDoc = new XmlDocument(); xmlDoc.LoadXml( "<configuration>" + "<appSettings>" + "<add key=\"umbracoConfigurationStatus\" value=\"1.1.1\" />" + "</appSettings>" + "</configuration>" ); xmlDocumentWrapper.LoadDocument(Arg.Any <string>()).Returns(xmlDoc); var deliverable = new UpgradeDeliverable(null, writer, migrationRunnerService, MigrationEntryService(new SemVersion(7, 1)), settings, xmlDocumentWrapper); var response = await deliverable.Run(null, null); Assert.Equal(2, writer.Messages.Count()); Assert.Equal(DeliverableResponse.Continue, response); }
public async Task SameVersions_NothingDone() { var deliverable = new UpgradeDeliverable(null, writer, null, MigrationEntryService(UmbracoVersion.GetSemanticVersion()), settings, xmlDocumentWrapper); var response = await deliverable.Run(null, null); Assert.Single(writer.Messages); Assert.Equal(DeliverableResponse.FinishedWithError, response); }
public async Task NoMigrationEntries_WillWarnAndExit() { var deliverable = new UpgradeDeliverable(null, writer, null, MigrationEntryService(), settings, xmlDocumentWrapper); var response = await deliverable.Run(null, null); Assert.Single(writer.Messages); Assert.Equal(DeliverableResponse.FinishedWithError, response); }
public async Task UpgradeFailes_ErrorStateReturned() { migrationRunnerService.Execute(Arg.Any <SemVersion>(), Arg.Any <SemVersion>()).Returns(false); var deliverable = new UpgradeDeliverable(null, writer, migrationRunnerService, MigrationEntryService(new SemVersion(7, 1)), settings, xmlDocumentWrapper); var response = await deliverable.Run(null, null); Assert.Equal(2, writer.Messages.Count()); Assert.Equal(DeliverableResponse.FinishedWithError, response); }