Add unit test

This commit is contained in:
sunkaixuan 2023-07-24 17:50:30 +08:00
parent 0b54710c69
commit f5bf8b7888

View File

@ -47,6 +47,63 @@ namespace OrmTest
}, },
isAutoFill: true) isAutoFill: true)
.ToListAsync().GetAwaiter().GetResult(); .ToListAsync().GetAwaiter().GetResult();
Check(items);
var items2 = _db.Queryable<JqdsrdbEntity>()
.Includes(dsr => dsr.Jqdsrgxbs)
.LeftJoin<JqdsrdbEntity>((x,y)=>x.Jqdsrdbh==y.Jqdsrdbh)
.Select((x,y) =>
new Resp
{
Sf = x.Jqdsrgxbs.Select(sf => sf.Sfmc),
IsShowOperationButton = true
},
isAutoFill: true)
.ToListAsync().GetAwaiter().GetResult();
Check(items2);
var items3 = _db.Queryable<JqdsrdbEntity>()
.Includes(dsr => dsr.Jqdsrgxbs)
.LeftJoin<JqdsrdbEntity>((x, y) => x.Jqdsrdbh == y.Jqdsrdbh)
.Select((x, y) =>
new Resp
{
Sf = x.Jqdsrgxbs.Select(sf => sf.Sfmc)
},
isAutoFill: true)
.ToListAsync().GetAwaiter().GetResult();
if (items3.First().IsShowOperationButton == false)
{
items3.First().IsShowOperationButton = true;
}
Check(items3);
var items4= _db.Queryable<JqdsrdbEntity>()
.Includes(dsr => dsr.Jqdsrgxbs)
.LeftJoin<JqdsrdbEntity>((x, y) => x.Jqdsrdbh == y.Jqdsrdbh)
.Select((x, y) =>
new Resp
{
Sf = x.Jqdsrgxbs.Select(sf => sf.Sfmc)
},
isAutoFill: true)
.MergeTable()
.ToListAsync().GetAwaiter().GetResult();
if (items4.First().IsShowOperationButton == false)
{
items4.First().IsShowOperationButton = true;
}
Check(items4);
}
private static void Check(List<Resp> items)
{
if (items.First().Jqdsrdbh != "a" || items.First().IsShowOperationButton == false || if (items.First().Jqdsrdbh != "a" || items.First().IsShowOperationButton == false ||
items.First().Sf.Count() == 0) items.First().Sf.Count() == 0)
{ {