public void WhenDefaultSchemaConventionIsChangedAndSchemaIsNotSetThenSetSchema() { var expression = new DeleteConstraintExpression(ConstraintType.Unique); var processed = expression.Apply(ConventionSets.WithSchemaName); Assert.That(processed.Constraint.SchemaName, Is.EqualTo("testdefault")); }
public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsNotSetThenSchemaShouldBeNull() { var expression = new DeleteConstraintExpression(ConstraintType.Unique); var processed = expression.Apply(ConventionSets.NoSchemaName); Assert.That(processed.Constraint.SchemaName, Is.Null); }
public void ApplyDefaultContraintName() { var expression = new DeleteConstraintExpression(ConstraintType.Unique); var builder = new DeleteConstraintExpressionBuilder(expression); builder.FromTable("Users").Column("AccountId"); var processed = expression.Apply(ConventionSets.NoSchemaName); Assert.That(processed.Constraint.ConstraintName, Is.EqualTo("UC_Users_AccountId")); }
public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsSetThenSchemaShouldNotBeChanged() { var expression = new DeleteConstraintExpression(ConstraintType.Unique) { Constraint = { SchemaName = "testschema", }, }; var processed = expression.Apply(ConventionSets.WithSchemaName); Assert.That(processed.Constraint.SchemaName, Is.EqualTo("testschema")); }