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
5ec61e410a
commit
2f814b140f
@ -49,11 +49,16 @@ namespace OrmTest
|
||||
};
|
||||
context.InsertNav(delivery).Include(s => s.DeliveryDetails).ThenInclude(s => s.DeliveryDetailItems).ExecuteCommand();
|
||||
var result = context.Queryable<Delivery>().Where(s => s.DeliveryNo == "1").Includes(s => s.DeliveryDetails, dd => dd.DeliveryDetailItems).First();
|
||||
|
||||
context.UpdateNav(result).Include(s => s.DeliveryDetails).ThenInclude(s => s.DeliveryDetailItems).ExecuteCommand();
|
||||
var result2 = context.Queryable<Delivery>().Where(s => s.DeliveryNo == "1").Includes(s => s.DeliveryDetails, dd => dd.DeliveryDetailItems).First();
|
||||
if (!result.DeliveryDetails.Any(z => z.DeliveryDetailItems.Any()))
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
if (!result2.DeliveryDetails.Any(z => z.DeliveryDetailItems.Any()))
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user