Files
Umbraco-CMS/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SchemaValidationTest.cs

32 lines
1.1 KiB
C#
Raw Normal View History

using Microsoft.Extensions.Logging;
2018-06-29 19:52:40 +02:00
using NUnit.Framework;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Tests.Common.Testing;
using Umbraco.Cms.Tests.Integration.Testing;
2018-06-29 19:52:40 +02:00
using Umbraco.Core.Migrations.Install;
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence
2018-06-29 19:52:40 +02:00
{
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)]
public class SchemaValidationTest : UmbracoIntegrationTest
2018-06-29 19:52:40 +02:00
{
private IUmbracoVersion UmbracoVersion => GetRequiredService<IUmbracoVersion>();
2018-06-29 19:52:40 +02:00
[Test]
public void DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors()
{
DatabaseSchemaResult result;
using (var scope = ScopeProvider.CreateScope())
{
var schema = new DatabaseSchemaCreator(scope.Database, LoggerFactory.CreateLogger<DatabaseSchemaCreator>(), LoggerFactory, UmbracoVersion);
result = schema.ValidateSchema(DatabaseSchemaCreator.OrderedTables);
2018-06-29 19:52:40 +02:00
}
// Assert
Assert.That(result.Errors.Count, Is.EqualTo(0));
}
}
}