Browse Source

Add unit test bug

pull/31/head
sunkaixuan 2 years ago
parent
commit
bf76982811
  1. 1
      Src/Asp.Net/SqliteTest/SqliteTest.csproj
  2. 1
      Src/Asp.Net/SqliteTest/UnitTest/Main.cs
  3. 38
      Src/Asp.Net/SqliteTest/UnitTest/UnitFilterdafa.cs

1
Src/Asp.Net/SqliteTest/SqliteTest.csproj

@ -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" />

1
Src/Asp.Net/SqliteTest/UnitTest/Main.cs

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

38
Src/Asp.Net/SqliteTest/UnitTest/UnitFilterdafa.cs

@ -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; }
}
}
Loading…
Cancel
Save