mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Add unit test
This commit is contained in:
@@ -15,13 +15,24 @@ namespace OrmTest
|
||||
if (x.Key.Contains("//") || x.Key.Contains("\\")) { throw new Exception("unit error"); }
|
||||
var x2 = db.Deleteable(new Date2() { dateTime = DateTime.Now, name = "a" }).ToSql();
|
||||
if (x2.Key.Contains("//") || x.Key.Contains("\\")) { throw new Exception("unit error"); }
|
||||
db.CodeFirst.InitTables<Date2, Date1>();
|
||||
db.CodeFirst.InitTables<Date2, Date1, Date3>();
|
||||
db.Deleteable(new Date1() { dateTime = DateTime.Now, name = "a" }).ExecuteCommand();
|
||||
db.Deleteable(new Date2() { dateTime = DateTime.Now, name = "a" }).ExecuteCommand();
|
||||
db.Insertable(new Date3() { name1 = "a" }).ExecuteCommand();
|
||||
db.Updateable(new Date3() { name1 = "a" }).ExecuteCommand();
|
||||
db.DbMaintenance.DropTable("Date1");
|
||||
db.DbMaintenance.DropTable("Date2");
|
||||
db.DbMaintenance.DropTable("Date3");
|
||||
}
|
||||
}
|
||||
|
||||
public class Date3
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, ColumnName = "date Time")]
|
||||
public DateTime dateTime { get; set; }
|
||||
[SqlSugar.SugarColumn( ColumnName = "name 1")]
|
||||
public string name1 { get; set; }
|
||||
}
|
||||
public class Date2
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
|
Reference in New Issue
Block a user