Exemplo n.º 1
0
        public override void CanCreateColumnWithSystemMethodAndDefaultSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression();
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE TestTable1 ADD TestColumn1 TIMESTAMP" + Environment.NewLine +
                @"UPDATE TestTable1 SET TestColumn1 = CURRENT_TIMESTAMP WHERE 1 = 1");
        }
Exemplo n.º 2
0
        public override void CanCreateColumnWithSystemMethodAndCustomSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression("TestSchema");
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE TestSchema.TestTable1 ADD COLUMN TestColumn1 VARGRAPHIC(5) CCSID 1200 DEFAULT" + Environment.NewLine +
                @"UPDATE TestSchema.TestTable1 SET TestColumn1 = CURRENT_TIMESTAMP");
        }
Exemplo n.º 3
0
        public override void CanCreateColumnWithSystemMethodAndCustomSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression("TestSchema");
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE `TestTable1` ADD COLUMN `TestColumn1` DATETIME" + Environment.NewLine +
                "UPDATE `TestTable1` SET `TestColumn1` = CURRENT_TIMESTAMP WHERE 1 = 1");
        }
Exemplo n.º 4
0
        public override void CanCreateColumnWithSystemMethodAndDefaultSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression();
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE [TestTable1] ADD [TestColumn1] NVARCHAR(5)" + Environment.NewLine +
                "UPDATE [TestTable1] SET [TestColumn1] = GETDATE() WHERE 1 = 1");
        }
Exemplo n.º 5
0
        public override void CanCreateColumnWithSystemMethodAndDefaultSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression();
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE ""public"".""TestTable1"" ADD ""TestColumn1"" timestamp;" + Environment.NewLine +
                @"UPDATE ""public"".""TestTable1"" SET ""TestColumn1"" = now() WHERE 1 = 1;");
        }
        public override void CanCreateColumnWithSystemMethodAndDefaultSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression();
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE ""TestTable1"" ADD COLUMN ""TestColumn1"" TEXT" + Environment.NewLine +
                @"UPDATE ""TestTable1"" SET ""TestColumn1"" = (datetime('now','localtime')) WHERE 1 = 1");
        }
        public override void CanCreateColumnWithSystemMethodAndCustomSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression("TestSchema");
            var result      = string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x)));

            result.ShouldBe(
                @"ALTER TABLE ""TestSchema"".""TestTable1"" ADD ""TestColumn1"" TIMESTAMP(4)" + Environment.NewLine +
                @"UPDATE ""TestSchema"".""TestTable1"" SET ""TestColumn1"" = LOCALTIMESTAMP WHERE 1 = 1");
        }
Exemplo n.º 8
0
        public override void CanCreateColumnWithSystemMethodAndDefaultSchema()
        {
            var expressions = GeneratorTestHelper.GetCreateColumnWithSystemMethodExpression();

            Assert.Throws <NotSupportedException>(() => string.Join(Environment.NewLine, expressions.Select(x => (string)Generator.Generate((dynamic)x))));
        }