public override void CallingColumnExistsCanAcceptColumnNameWithSingleQuote()
        {
            var columnNameWithSingleQuote = Quoter.Quote("i'd");

            using (var table = new SqlServerTestTable(Processor, null, string.Format("{0} int", columnNameWithSingleQuote)))
                Processor.ColumnExists(null, table.Name, "i'd").ShouldBeTrue();
        }
Exemplo n.º 2
0
        public override void CallingConstraintExistsCanAcceptConstraintNameWithSingleQuote()
        {
            var constraintName = Quoter.QuoteConstraintName("c'1");

            using (var table = new SqlServerTestTable(Processor, null, "id int", string.Format("wibble int CONSTRAINT {0} CHECK(wibble > 0)", constraintName)))
                Processor.ConstraintExists(null, table.Name, "c'1").ShouldBeTrue();
        }
 public override void CallingIndexExistsCanAcceptSchemaNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable(Processor, "test'schema", "id int"))
     {
         var indexName = table.WithIndexOn("id");
         Processor.IndexExists("test'schema", table.Name, indexName).ShouldBeTrue();
     }
 }
 public void CallingDefaultValueExistsCanAcceptSchemaNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable(Processor, "test'schema", "id int"))
     {
         table.WithDefaultValueOn("id");
         Processor.DefaultValueExists("test'schema", table.Name, "id", 1).ShouldBeTrue();
     }
 }
Exemplo n.º 5
0
 public override void CallingIndexExistsCanAcceptTableNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable("Test'Table", Processor, null, "id int"))
     {
         var indexName = table.WithIndexOn("id");
         Processor.IndexExists(null, table.Name, indexName).ShouldBeTrue();
     }
 }
Exemplo n.º 6
0
 public override void CallingIndexExistsReturnsTrueIfIndexExists()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int"))
     {
         var indexName = table.WithIndexOn("id");
         Processor.IndexExists(null, table.Name, indexName).ShouldBeTrue();
     }
 }
Exemplo n.º 7
0
        public override void CallingIndexExistsCanAcceptIndexNameWithSingleQuote()
        {
            const string columnSingleQuote = "i'd";

            using (var table = new SqlServerTestTable(Processor, null, Quoter.Quote(columnSingleQuote) + " int"))
            {
                var indexName = table.WithIndexOn(columnSingleQuote);
                Processor.IndexExists(null, table.Name, indexName).ShouldBeTrue();
            }
        }
Exemplo n.º 8
0
        public void CanReadSchemaInfoWithNullable()
        {
            using (var table = new SqlServerTestTable(Processor, null, "id int NULL"))
            {
                IList <TableDefinition> defs = SchemaDumper.ReadDbSchema();

                var identityColumn = defs[0].Columns.First();
                identityColumn.Name.ShouldBe("id");
                identityColumn.IsNullable.ShouldBe(true);
            }
        }
Exemplo n.º 9
0
        public void CanReadBasicSchemaInfo()
        {
            // this is the fun part.. this test should fail until the schema reading code works
            // also assume the target database contains schema described in TestMigration
            using (var table = new SqlServerTestTable(Processor, null, "id int")) {
                IList <TableDefinition> defs = SchemaDumper.ReadDbSchema();

                SchemaTestWriter testWriter = new SchemaTestWriter();
                var    output          = GetOutput(testWriter, defs);
                string expectedMessage = testWriter.GetMessage(1, 1, 0, 0);

                output.ShouldBe(expectedMessage);
            }
        }
Exemplo n.º 10
0
 public override void CallingIndexExistsReturnsFalseIfIndexDoesNotExistWithSchema()
 {
     using (var table = new SqlServerTestTable(Processor, "test_schema", "id int"))
         Processor.IndexExists("test_schema", table.Name, "DoesNotExist").ShouldBeFalse();
 }
 public override void CallingTableExistsReturnsTrueIfTableExists()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int"))
         Processor.TableExists(null, table.Name).ShouldBeTrue();
 }
Exemplo n.º 12
0
 public void CallingConstraintExistsReturnsFalseIfConstraintExistsInDifferentSchema()
 {
     using (var table = new SqlServerTestTable(Processor, "test_schema", "id int",
                                               "wibble int CONSTRAINT c1 CHECK(wibble > 0)"))
         Processor.ConstraintExists("test_schema2", table.Name, "c1").ShouldBeFalse();
 }
Exemplo n.º 13
0
 public override void CallingIndexExistsReturnsFalseIfIndexDoesNotExist()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int"))
         Processor.IndexExists(null, table.Name, "DoesNotExist").ShouldBeFalse();
 }
Exemplo n.º 14
0
 public void CallingColumnExistsReturnsFalseIfColumnDoesNotExistWithSchema()
 {
     using (var table = new SqlServerTestTable(Processor, "test_schema", "id int"))
         Processor.ColumnExists("test_schema", table.Name, "DoesNotExist").ShouldBeFalse();
 }
Exemplo n.º 15
0
 public void CallingTableExistsReturnsFalseIfTableExistsInDifferentSchema()
 {
     using (var table = new SqlServerTestTable(Processor, "test_schema", "id int"))
         Processor.TableExists("test_schema2", table.Name).ShouldBeFalse();
 }
Exemplo n.º 16
0
 public void CallingColumnExistsReturnsTrueIfColumnExists()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int"))
         Processor.ColumnExists(null, table.Name, "id").ShouldBeTrue();
 }
 public override void CallingTableExistsCanAcceptSchemaNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable(Processor, "test'schema", "id int"))
         Processor.TableExists("test'schema", table.Name).ShouldBeTrue();
 }
 public override void CallingConstraintExistsCanAcceptSchemaNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable(Processor, "test'schema", "id int", "wibble int CONSTRAINT c1 CHECK(wibble > 0)"))
         Processor.ConstraintExists("test'schema", table.Name, "c1").ShouldBeTrue();
 }
 public override void CallingTableExistsReturnsTrueIfTableExistsWithSchema()
 {
     using (var table = new SqlServerTestTable(Processor, "test_schema", "id int"))
         Processor.TableExists("test_schema", table.Name).ShouldBeTrue();
 }
Exemplo n.º 20
0
 public void CallingColumnExistsReturnsFalseIfColumnDoesNotExist()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int"))
         Processor.ColumnExists(null, table.Name, "DoesNotExist").ShouldBeFalse();
 }
 public override void CallingTableExistsCanAcceptTableNameWithSingleQuote()
 {
     using (var table = new SqlServerTestTable("Test'Table", Processor, null, "id int"))
         Processor.TableExists(null, table.Name).ShouldBeTrue();
 }
Exemplo n.º 22
0
 public override void CallingConstraintExistsReturnsTrueIfConstraintExists()
 {
     using (var table = new SqlServerTestTable(Processor, null, "id int", "wibble int CONSTRAINT c1 CHECK(wibble > 0)"))
         Processor.ConstraintExists(null, table.Name, "c1").ShouldBeTrue();
 }