mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
ea65c545d5
commit
1e1a8e0f14
@ -97,6 +97,7 @@
|
|||||||
<Compile Include="Models\OrderItem.cs" />
|
<Compile Include="Models\OrderItem.cs" />
|
||||||
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
|
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
|
||||||
<Compile Include="Models\ViewOrder.cs" />
|
<Compile Include="Models\ViewOrder.cs" />
|
||||||
|
<Compile Include="UnitTest\UCustom20.cs" />
|
||||||
<Compile Include="UnitTest\UnitUpdateSubQuery.cs" />
|
<Compile Include="UnitTest\UnitUpdateSubQuery.cs" />
|
||||||
<Compile Include="UnitTest\UnitManyToManyDeleteNav.cs" />
|
<Compile Include="UnitTest\UnitManyToManyDeleteNav.cs" />
|
||||||
<Compile Include="UnitTest\UnitCustom12312.cs" />
|
<Compile Include="UnitTest\UnitCustom12312.cs" />
|
||||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UCustom20.Init();
|
||||||
UTran2.Init();
|
UTran2.Init();
|
||||||
UnitUpdateSubQuery.Init();
|
UnitUpdateSubQuery.Init();
|
||||||
UnitManyToManyDeleteNav.Init();
|
UnitManyToManyDeleteNav.Init();
|
||||||
|
38
Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs
Normal file
38
Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
public class UCustom20
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
var list = db.Queryable<Order>()
|
||||||
|
.Take(2)
|
||||||
|
.Select(i => new TestDTO
|
||||||
|
{
|
||||||
|
SubOne = new TestSubDTO { NameOne = i.Name, NameTwo = i.Name },
|
||||||
|
SubTwo = new TestSubDTO { NameOne = i.Name, NameTwo = i.Name }
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestDTO
|
||||||
|
{
|
||||||
|
public TestSubDTO SubOne { get; set; }
|
||||||
|
|
||||||
|
public TestSubDTO SubTwo { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestSubDTO
|
||||||
|
{
|
||||||
|
public string NameOne { get; set; }
|
||||||
|
|
||||||
|
public string NameTwo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user