mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-21 02:57:33 +08:00
Add unit test
This commit is contained in:
@@ -98,6 +98,7 @@
|
|||||||
<Compile Include="UnitTest\UCustom01.cs" />
|
<Compile Include="UnitTest\UCustom01.cs" />
|
||||||
<Compile Include="UnitTest\UCustom02.cs" />
|
<Compile Include="UnitTest\UCustom02.cs" />
|
||||||
<Compile Include="UnitTest\UCustom03.cs" />
|
<Compile Include="UnitTest\UCustom03.cs" />
|
||||||
|
<Compile Include="UnitTest\UCustom05.cs" />
|
||||||
<Compile Include="UnitTest\UCustom04.cs" />
|
<Compile Include="UnitTest\UCustom04.cs" />
|
||||||
<Compile Include="UnitTest\UDelete.cs" />
|
<Compile Include="UnitTest\UDelete.cs" />
|
||||||
<Compile Include="UnitTest\UFastest.cs" />
|
<Compile Include="UnitTest\UFastest.cs" />
|
||||||
|
@@ -35,6 +35,7 @@ namespace OrmTest
|
|||||||
UCustom02.Init();
|
UCustom02.Init();
|
||||||
UCustom03.Init();
|
UCustom03.Init();
|
||||||
UCustom04.Init();
|
UCustom04.Init();
|
||||||
|
UCustom05.Init();
|
||||||
SubQueryTest();
|
SubQueryTest();
|
||||||
UConfig();
|
UConfig();
|
||||||
DeleteTest();
|
DeleteTest();
|
||||||
|
22
Src/Asp.Net/SqlServerTest/UnitTest/UCustom05.cs
Normal file
22
Src/Asp.Net/SqlServerTest/UnitTest/UCustom05.cs
Normal 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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user