From 77d70c7e7f2fac6e2a1e611fb8f56d5de33412ba Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 12 Feb 2019 11:43:34 +1100 Subject: [PATCH] Fixes test --- .../Migrations/Install/DatabaseSchemaCreator.cs | 7 ++++++- src/Umbraco.Tests/Persistence/SchemaValidationTest.cs | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs index b33e624576..d8283fd112 100644 --- a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs @@ -137,13 +137,18 @@ namespace Umbraco.Core.Migrations.Install /// Validates the schema of the current database. /// internal DatabaseSchemaResult ValidateSchema() + { + return ValidateSchema(OrderedTables); + } + + internal DatabaseSchemaResult ValidateSchema(IEnumerable orderedTables) { var result = new DatabaseSchemaResult(SqlSyntax); result.IndexDefinitions.AddRange(SqlSyntax.GetDefinedIndexes(_database) .Select(x => new DbIndexDefinition(x))); - result.TableDefinitions.AddRange(OrderedTables + result.TableDefinitions.AddRange(orderedTables .Select(x => DefinitionFactory.GetTableDefinition(x, SqlSyntax))); ValidateDbTables(result); diff --git a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs index 2c875d6afc..c7118dac79 100644 --- a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs +++ b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs @@ -1,9 +1,11 @@ -using Moq; +using System.Linq; +using Moq; using NUnit.Framework; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Migrations.Install; using Umbraco.Core.Persistence.SqlSyntax; +using Umbraco.Tests.LegacyXmlPublishedCache; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; @@ -21,7 +23,9 @@ namespace Umbraco.Tests.Persistence using (var scope = ScopeProvider.CreateScope()) { var schema = new DatabaseSchemaCreator(scope.Database, Logger); - result = schema.ValidateSchema(); + result = schema.ValidateSchema( + //TODO: When we remove the xml cache from tests we can remove this too + DatabaseSchemaCreator.OrderedTables.Concat(new []{typeof(ContentXmlDto), typeof(PreviewXmlDto)})); } // Assert