Helps determine if valid database exists and which version it corresponds to. On startup the legacy connectionstring is used if one exists, so its not ignore but rather reconfigured. Relates to U4-1520.
38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using NUnit.Framework;
|
|
using Umbraco.Core.Configuration;
|
|
using Umbraco.Core.Persistence.Migrations.Initial;
|
|
using Umbraco.Tests.TestHelpers;
|
|
|
|
namespace Umbraco.Tests.Persistence
|
|
{
|
|
[TestFixture]
|
|
public class SchemaValidationTest : BaseDatabaseFactoryTest
|
|
{
|
|
[SetUp]
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
}
|
|
|
|
[TearDown]
|
|
public override void TearDown()
|
|
{
|
|
base.TearDown();
|
|
}
|
|
|
|
[Test]
|
|
public void DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors()
|
|
{
|
|
// Arrange
|
|
var db = DatabaseContext.Database;
|
|
var schema = new DatabaseSchemaCreation(db);
|
|
|
|
// Act
|
|
var result = schema.ValidateSchema();
|
|
|
|
// Assert
|
|
Assert.That(result.Errors.Count, Is.EqualTo(0));
|
|
Assert.AreEqual(result.DetermineInstalledVersion(), UmbracoVersion.Current);
|
|
}
|
|
}
|
|
} |