Add unit test bug

This commit is contained in:
sunkaixuan 2023-02-03 16:18:15 +08:00
parent 7765690ff7
commit bf76982811
3 changed files with 40 additions and 0 deletions

View File

@ -77,6 +77,7 @@
<Compile Include="Models\TestTree.cs" />
<Compile Include="Models\Tree.cs" />
<Compile Include="Models\ViewOrder.cs" />
<Compile Include="UnitTest\UnitFilterdafa.cs" />
<Compile Include="UnitTest\Models\BilPayment.cs" />
<Compile Include="UnitTest\UInsert3.cs" />
<Compile Include="UnitTest\Unit01.cs" />

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
UnitFilterdafa.Init();
UInsert3.Init();
USaveable.Init();
UnitSubToList.Init();

View 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 UnitFilterdafa
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<UintLeft0123, UintRight0123>();
db.QueryFilter.AddTableFilter<IDEL>(it => it.IsDeleted == false);
db.Queryable<UintLeft0123>().LeftJoin<UintRight0123>((x, y) => x.Id == y.Id)
.ToList();
}
}
public class UintLeft0123 : IDEL
{
public string Id { get; set; }
[SqlSugar.SugarColumn(ColumnName = "Is_Deleted")]
public bool IsDeleted { get; set; }
}
public class UintRight0123: IDEL
{
public string Id { get; set; }
[SqlSugar.SugarColumn(ColumnName = "Is_Deleted")]
public bool IsDeleted { get; set; }
}
public interface IDEL
{
bool IsDeleted { get; set; }
}
}