public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsSetThenSchemaShouldNotBeChanged() { var indexDefinition = new IndexDefinition { Name = "Test", SchemaName = "testschema" }; indexDefinition.ApplyConventions(new MigrationConventions()); Assert.That(indexDefinition.SchemaName, Is.EqualTo("testschema")); }
public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsNotSetThenSchemaShouldBeNull() { var indexDefinition = new IndexDefinition { Name = "Test" }; indexDefinition.ApplyConventions(new MigrationConventions()); Assert.That(indexDefinition.SchemaName, Is.Null); }
public void ShouldApplyIndexNameConventionWhenIndexNameIsNull() { var indexDefinition = new IndexDefinition(); var conventions = new MigrationConventions { GetIndexName = definition => "IX_Table_Name" }; indexDefinition.ApplyConventions(conventions); Assert.AreEqual("IX_Table_Name", indexDefinition.Name); }
public void WhenDefaultSchemaConventionIsChangedAndSchemaIsNotSetThenSetSchema() { var indexDefinition = new IndexDefinition { Name = "Test" }; var migrationConventions = new MigrationConventions { GetDefaultSchema = () => "testdefault" }; indexDefinition.ApplyConventions(migrationConventions); Assert.That(indexDefinition.SchemaName, Is.EqualTo("testdefault")); }