Example #1
0
        public void TestGenerateDropTableSql_没有其他字段()
        {
            MSSql2005Creater creater = new MSSql2005Creater();
            string           sql     = creater.GenerateDropTableSql(typeof(NoneFieldDbEnityClass));

            StringBuilder sqlCreate = new StringBuilder();

            sqlCreate.AppendLine("IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[NoneFieldDbEnityClass]') AND type in (N'U'))");
            sqlCreate.AppendLine("DROP TABLE [NoneFieldDbEnityClass]");
            sqlCreate.AppendLine("GO");

            Assert.AreEqual(sqlCreate.ToString(), sql);
        }
        public void TestGenerateDropTableSql_有多个字段()
        {
            MSSql2005Creater creater = new MSSql2005Creater();
            string sql = creater.GenerateDropTableSql(typeof(MultiFieldDbEnityClass));

            StringBuilder sqlCreate = new StringBuilder();
            sqlCreate.AppendLine("IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[MultiFieldDbEnityClass]') AND type in (N'U'))");
            sqlCreate.AppendLine("DROP TABLE [MultiFieldDbEnityClass]");
            sqlCreate.AppendLine("GO");

            Assert.AreEqual(sqlCreate.ToString(), sql);
        }
 public void TestGenerateDropTableSql_不是DbEntity类型()
 {
     MSSql2005Creater creater = new MSSql2005Creater();
     string sql = creater.GenerateDropTableSql(typeof(NotDbEnityClass));
 }
Example #4
0
 public void TestGenerateDropTableSql_不是DbEntity类型()
 {
     MSSql2005Creater creater = new MSSql2005Creater();
     string           sql     = creater.GenerateDropTableSql(typeof(NotDbEnityClass));
 }