From fdf8c28112b552dac3d09e0da421a4984b61839d Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 14 Jul 2025 17:51:37 +0800 Subject: [PATCH] Add user test case --- .../UserTestCases/UnitTest/Main.cs | 1 + .../UserTestCases/UnitTest/Unitdfayssf.cs | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitdfayssf.cs diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs index 606a42adf..437460cc4 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs @@ -33,6 +33,7 @@ namespace OrmTest } public static void Init() { + Unitdfayssf.Init(); Unitdsfasdfys.Init(); Unitsadfasys.Init(); Unitsadfasys.Init(); diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitdfayssf.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitdfayssf.cs new file mode 100644 index 000000000..3c3b09e7c --- /dev/null +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Unitdfayssf.cs @@ -0,0 +1,46 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + internal class Unitdfayssf + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + var list=db.Queryable() + .Where(x => x.CreateTime > DateTime.Now.AddDays(-6) + && (x.Status & OrderStatus.Aborted) == 0 + && (x.Status & OrderStatus.Executed) == 0) + .ToList(); + } + [SugarTable("Unitsdfadsfydsly")] + + public class Order + { + [SugarColumn(IsPrimaryKey = true)] + public int Id { get; set; } + public DateTime CreateTime { get; set; } + public OrderStatus Status { get; set; } + } + public enum OrderStatus + { + Aborted = 0x04, + Executed = 0x40 + } + + public class TestDateTime + { + [SugarColumn(IsPrimaryKey = true)] + public int Id { get; set; } + public DateTime CreateTime { get; set; } + public DateTime? UpdateTime { get; set; } + } + } + +}