mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
5b280b8d2c
commit
3e1c03ed62
@ -95,9 +95,25 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
throw new Exception("unit error");
|
throw new Exception("unit error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db.CodeFirst.InitTables<UnitDecmaildfa>();
|
||||||
|
db.DbMaintenance.TruncateTable<UnitDecmaildfa>();
|
||||||
|
db.Insertable(new UnitDecmaildfa() { Id = 1, Name = "a" }).ExecuteCommand();
|
||||||
|
var x1=db.Storageable(new UnitDecmaildfa() { Id = 1, Name = "a" }).ToStorage();
|
||||||
|
if (!x1.UpdateList.Any())
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
|
db.DbMaintenance.DropTable<UnitDecmaildfa>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UnitDecmaildfa
|
||||||
|
{
|
||||||
|
|
||||||
|
[SqlSugar.SugarColumn(IsPrimaryKey =true)]
|
||||||
|
public decimal? Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public static List<T> Search<T>(SqlSugarClient db) where T : ISearch
|
public static List<T> Search<T>(SqlSugarClient db) where T : ISearch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user