예제 #1
0
        public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsSetThenSchemaShouldNotBeChanged()
        {
            var expression = new RenameColumnExpression {
                SchemaName = "testschema", TableName = "Bacon", OldName = "BaconId", NewName = "ChunkyBaconId"
            };

            expression.ApplyConventions(new MigrationConventions());

            Assert.That(expression.SchemaName, Is.EqualTo("testschema"));
        }
예제 #2
0
        public void WhenDefaultSchemaConventionIsAppliedAndSchemaIsNotSetThenSchemaShouldBeNull()
        {
            var expression = new RenameColumnExpression {
                TableName = "Bacon", OldName = "BaconId", NewName = "ChunkyBaconId"
            };

            expression.ApplyConventions(new MigrationConventions());

            Assert.That(expression.SchemaName, Is.Null);
        }
예제 #3
0
        public void WhenDefaultSchemaConventionIsChangedAndSchemaIsNotSetThenSetSchema()
        {
            var expression = new RenameColumnExpression {
                TableName = "Bacon", OldName = "BaconId", NewName = "ChunkyBaconId"
            };
            var migrationConventions = new MigrationConventions {
                GetDefaultSchema = () => "testdefault"
            };

            expression.ApplyConventions(migrationConventions);

            Assert.That(expression.SchemaName, Is.EqualTo("testdefault"));
        }