示例#1
0
        public void CanGetIndexeColumnsFromIndexDDLSimple()
        {
            //var indexDDL1 = @"CREATE INDEX [IDX_USERS_LastLogin] ON [Users]([LastLogin]  DESC)";
            var indexDDL1 = @"[LastLogin]  DESC";
            var columns11 = SqliteSchemaDumper.GetIndexColumnsFromIndexDDL(indexDDL1);

            Assert.IsNotEmpty(columns11);
            columns11.Count.ShouldBe(1);
            var index1 = columns11.First();

            index1.Name.ShouldBe("LastLogin");
            index1.Direction.ShouldBe(Direction.Descending);
        }
示例#2
0
        public void CanGetIndexeColumnsFromIndexDDLComplex()
        {
            var indexDDL1 = @"[FirstName]  ASC,[LastName]  DESC";
            var columns11 = SqliteSchemaDumper.GetIndexColumnsFromIndexDDL(indexDDL1);

            Assert.IsNotEmpty(columns11);
            Assert.AreEqual(columns11.Count, 2, "Should have 2 index column!");

            var index1 = columns11.First();

            Assert.AreEqual(index1.Name, "FirstName");
            Assert.AreEqual(index1.Direction, Direction.Ascending);

            var index2 = columns11.Last();

            Assert.AreEqual(index2.Name, "LastName");
            Assert.AreEqual(index2.Direction, Direction.Descending);
        }