Add unit test

This commit is contained in:
sunkaixuna 2022-01-09 14:39:11 +08:00
parent 71ef2a95e7
commit 45bc377952
3 changed files with 24 additions and 0 deletions

View File

@ -98,6 +98,7 @@
<Compile Include="UnitTest\UCustom01.cs" />
<Compile Include="UnitTest\UCustom02.cs" />
<Compile Include="UnitTest\UCustom03.cs" />
<Compile Include="UnitTest\UCustom05.cs" />
<Compile Include="UnitTest\UCustom04.cs" />
<Compile Include="UnitTest\UDelete.cs" />
<Compile Include="UnitTest\UFastest.cs" />

View File

@ -35,6 +35,7 @@ namespace OrmTest
UCustom02.Init();
UCustom03.Init();
UCustom04.Init();
UCustom05.Init();
SubQueryTest();
UConfig();
DeleteTest();

View File

@ -0,0 +1,22 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class UCustom05
{
public static void Init()
{
var db = NewUnitTest.Db;
var id=db.Insertable(new Order() { CreateTime = DateTime.Now, Name = "a", Price = 111, CustomId = 1 }).ExecuteReturnIdentity();
var data = db.GetSimpleClient<Order>().GetById(id);
var x=db.Storageable(data).WhereColumns(it=>it.Price).ToStorage();
Check.Exception(x.UpdateList.Count == 0, "unit error");
}
}
}