Update unit test

This commit is contained in:
sunkaixuan
2023-07-17 15:21:01 +08:00
parent 5890321094
commit 68c2fadfe2

View File

@@ -80,14 +80,14 @@ namespace OrmTest
var result3 = db.Queryable<Country, Province, City>( var result3 = db.Queryable<Country, Province, City>(
(co, pr, ci) => co.ProvinceId == pr.ProvinceId && ci.ProvinceId == ci.ProvinceId) (co, pr, ci) => co.ProvinceId == pr.ProvinceId && ci.ProvinceId == ci.ProvinceId)
.Select((co, pr, ci) => new Country() .Select((co, pr, ci) => new
{ {
CountryId = co.CountryId, CountryId = co.CountryId,
ProvinceId = co.ProvinceId, ProvinceId = co.ProvinceId,
Province = new Province() Province2= new
{ {
ProvinceId = pr.ProvinceId, ProvinceId = pr.ProvinceId,
City = new City() City2 = new
{ {
ProvinceId = ci.ProvinceId, ProvinceId = ci.ProvinceId,
CityId = ci.CityId, CityId = ci.CityId,
@@ -97,8 +97,8 @@ namespace OrmTest
.ToList(); .ToList();
if (result3.First().Province.City.ProvinceId != 1 || if (result3.First().Province2.City2.ProvinceId != 1 ||
result3.Last().Province.City.ProvinceId != 2) result3.Last().Province2.City2.ProvinceId != 2)
{ {
throw new Exception("unit error"); throw new Exception("unit error");
} }