Fixes test

This commit is contained in:
Shannon
2019-02-12 11:43:34 +11:00
parent 3d729eb2c3
commit 77d70c7e7f
2 changed files with 12 additions and 3 deletions

View File

@@ -137,13 +137,18 @@ namespace Umbraco.Core.Migrations.Install
/// Validates the schema of the current database.
/// </summary>
internal DatabaseSchemaResult ValidateSchema()
{
return ValidateSchema(OrderedTables);
}
internal DatabaseSchemaResult ValidateSchema(IEnumerable<Type> 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);

View File

@@ -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