public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsNotSetThenSchemaShouldBeNull() { var constraintDefinition = new ConstraintDefinition(ConstraintType.PrimaryKey) { ConstraintName = "Test" }; constraintDefinition.ApplyConventions(new MigrationConventions()); Assert.That(constraintDefinition.SchemaName, Is.Null); }
public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsSetThenSchemaShouldNotBeChanged() { var constraintDefinition = new ConstraintDefinition(ConstraintType.PrimaryKey) { ConstraintName = "Test", SchemaName = "testschema" }; constraintDefinition.ApplyConventions(new MigrationConventions()); Assert.That(constraintDefinition.SchemaName, Is.EqualTo("testschema")); }
public void WhenDefaultSchemaConventionIsChangedAndSchemaIsNotSetThenSetSchema() { var constraintDefinition = new ConstraintDefinition(ConstraintType.PrimaryKey) { ConstraintName = "Test" }; var migrationConventions = new MigrationConventions { GetDefaultSchema = () => "testdefault" }; constraintDefinition.ApplyConventions(migrationConventions); Assert.That(constraintDefinition.SchemaName, Is.EqualTo("testdefault")); }