Add unit test

This commit is contained in:
sunkaixuan
2023-06-06 17:19:05 +08:00
parent 8161e05a4c
commit 70e9d8b287

View File

@@ -1,6 +1,7 @@
using SqlSugar; using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
@@ -120,6 +121,38 @@ namespace OrmTest
}) })
.ToList(); .ToList();
if (!list6.First().books.Any())
{
throw new Exception("unit error");
}
var list7=db.SqlQueryable<Student_004>("select * from [Student_005]")
.Includes(x => x.school_001)
.ToList();
if (list7.First().school_001==null)
{
throw new Exception("unit error");
}
var list8 = db.Queryable(db.Queryable<Student_004>())
.Includes(x => x.school_001)
.ToList();
if (list8.First().school_001 == null)
{
throw new Exception("unit error");
}
var list9 = db.Queryable<Student_004>()
.MergeTable()
.Includes(x => x.school_001)
.ToList();
if (list9.First().school_001 == null)
{
throw new Exception("unit error");
}
} }