[fix]修正单元测试逻辑,改逻辑在晚上23点之后跑,加1小时跨天,导致单元测试无法通过

This commit is contained in:
大石头 2025-06-27 23:50:30 +08:00
parent a189fb666e
commit 27a733548f
1 changed files with 4 additions and 3 deletions

View File

@ -24,8 +24,9 @@ public class TimeShardTests
Assert.Throws<XSqlException>(() => ExpressLogs.FindCount());
// 分表查询,没有数据
var time = DateTime.Now.AddHours(1);
var list = ExpressLogs.Search(time.Date, time, null, null);
var start = DateTime.Now;
var time = start.AddHours(1);
var list = ExpressLogs.Search(start.Date, time, null, null);
Assert.Empty(list);
// 写入数据
@ -35,7 +36,7 @@ public class TimeShardTests
};
entity.Insert();
list = ExpressLogs.Search(time.Date, time, null, null);
list = ExpressLogs.Search(start.Date, time, null, null);
Assert.Single(list);
//var n = ExpressLogs.Meta.Count;