Add unit test

This commit is contained in:
sunkaixuan 2022-09-19 19:42:42 +08:00
parent 368290f119
commit c4dffaf9ac
4 changed files with 49 additions and 0 deletions

View File

@ -97,6 +97,8 @@
<Compile Include="Models\OrderItem.cs" />
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
<Compile Include="Models\ViewOrder.cs" />
<Compile Include="UnitTest\ITestExo.cs" />
<Compile Include="UnitTest\UExp.cs" />
<Compile Include="UnitTest\UCustom24.cs" />
<Compile Include="UnitTest\UCustom20.cs" />
<Compile Include="UnitTest\UnitUpdateSubQuery.cs" />

View File

@ -0,0 +1,7 @@
namespace OrmTest
{
public interface ITestExo
{
Order GetCurrentOrder { get; }
}
}

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
UExp.Init();
USelectSinleDTO.Init();
UCustom024.Init();
UCustom24.Init();

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class UExp
{
public static void Init()
{
new UExp().Test();
}
private readonly ITestExo order;
public UExp()
{
order = new TestExo();
}
public void Test()
{
var list = NewUnitTest.Db.Queryable<Order>().Where(it => it.Id == order.GetCurrentOrder.Id).ToList();
}
}
public class TestExo : ITestExo
{
public Order GetCurrentOrder
{
get
{
return new Order();
}
}
}
}