fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 3s

This commit is contained in:
SunCheng
2026-01-30 10:41:19 +08:00
parent d9703d31ae
commit 704f58b1a1
46 changed files with 6074 additions and 301 deletions

View File

@@ -60,7 +60,7 @@ public class BudgetRepositoryTest : TransactionTestBase
var b1_updated = all.First(b => b.Name == "B1");
b1_updated.SelectedCategories.Should().Contain("美食");
b1_updated.SelectedCategories.Should().NotContain("餐饮");
var b2_updated = all.First(b => b.Name == "B2");
b2_updated.SelectedCategories.Should().Be("美食");
}

View File

@@ -13,7 +13,7 @@ public class ConfigRepositoryTest : RepositoryTestBase
public async Task GetByKeyAsync_获取配置_Test()
{
await _repository.AddAsync(new ConfigEntity { Key = "k1", Value = "v1" });
var config = await _repository.GetByKeyAsync("k1");
config.Should().NotBeNull();
config.Value.Should().Be("v1");

View File

@@ -13,10 +13,10 @@ public class EmailMessageRepositoryTest : RepositoryTestBase
public async Task ExistsAsync_检查存在_Test()
{
await _repository.AddAsync(new EmailMessage { Md5 = "md5_value", Subject = "Test" });
var msg = await _repository.ExistsAsync("md5_value");
msg.Should().NotBeNull();
var notfound = await _repository.ExistsAsync("other");
notfound.Should().BeNull();
}
@@ -33,7 +33,7 @@ public class EmailMessageRepositoryTest : RepositoryTestBase
// Assuming ID order follows insertion (mostly true for snowflakes if generated sequentially)
// But ReceivedDate is the primary sort in logic usually.
// Let's verify standard cursor pagination usually sorts by Date DESC, ID DESC.
await _repository.AddAsync(m1);
await _repository.AddAsync(m2);
await _repository.AddAsync(m3);

View File

@@ -13,7 +13,7 @@ public class PushSubscriptionRepositoryTest : RepositoryTestBase
public async Task GetByEndpointAsync_通过Endpoint获取_Test()
{
await _repository.AddAsync(new PushSubscription { Endpoint = "ep1" });
var sub = await _repository.GetByEndpointAsync("ep1");
sub.Should().NotBeNull();
sub.Endpoint.Should().Be("ep1");

View File

@@ -14,10 +14,10 @@ public class TransactionPeriodicRepositoryTest : TransactionTestBase
{
// 应该执行的NextExecuteTime <= Now
await _repository.AddAsync(new TransactionPeriodic { Reason = "Bill1", NextExecuteTime = DateTime.Now.AddDays(-1), IsEnabled = true });
// 不该执行的NextExecuteTime > Now
await _repository.AddAsync(new TransactionPeriodic { Reason = "Bill2", NextExecuteTime = DateTime.Now.AddDays(1), IsEnabled = true });
// 不该执行的:未激活
await _repository.AddAsync(new TransactionPeriodic { Reason = "Bill3", NextExecuteTime = DateTime.Now.AddDays(-1), IsEnabled = false });

View File

@@ -47,11 +47,11 @@ public class TransactionRecordRepositoryTest : TransactionTestBase
var results = await _repository.QueryAsync(
startDate: new DateTime(2023, 1, 1),
endDate: new DateTime(2023, 2, 28)); // Include Feb
results.Should().HaveCount(2);
}
[Fact]
[Fact]
public async Task QueryAsync_按年月筛选_Test()
{
await _repository.AddAsync(CreateExpense(100, new DateTime(2023, 1, 15)));
@@ -99,7 +99,7 @@ public class TransactionRecordRepositoryTest : TransactionTestBase
var records = await _repository.QueryAsync(reason: "麦当劳");
records.All(r => r.Classify == "快餐").Should().BeTrue();
var kfc = await _repository.QueryAsync(reason: "肯德基");
kfc.First().Classify.Should().Be("餐饮");
}