fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 25s
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 2s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 25s
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 2s
This commit is contained in:
@@ -94,10 +94,11 @@ public class BudgetStatsTest : BaseTest
|
||||
var result = await _service.GetCategoryStatsAsync(BudgetCategory.Expense, referenceDate);
|
||||
|
||||
// Assert
|
||||
// 1月有31天,15号经过了15天
|
||||
// 3100 * 15 / 31 = 1500
|
||||
// 硬性预算的限额保持不变,不根据时间计算
|
||||
result.Month.Limit.Should().Be(3100);
|
||||
result.Month.Current.Should().Be(1500);
|
||||
// 实际使用值根据时间计算:1月有31天,15号经过了15天
|
||||
// 3100 * 15 / 31 ≈ 1500
|
||||
result.Month.Current.Should().BeApproximately(1500, 1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -188,10 +189,11 @@ public class BudgetStatsTest : BaseTest
|
||||
var result = await _service.GetCategoryStatsAsync(BudgetCategory.Expense, referenceDate);
|
||||
|
||||
// Assert
|
||||
// 2024是闰年,366天。1月1号是第1天。
|
||||
// 3660 * 1 / 366 = 10
|
||||
// 硬性预算的限额保持不变
|
||||
result.Year.Limit.Should().Be(3660);
|
||||
result.Year.Current.Should().Be(10);
|
||||
// 实际使用值根据时间计算:2024是闰年,366天。1月1号是第1天。
|
||||
// 3660 * 1 / 366 ≈ 10
|
||||
result.Year.Current.Should().BeApproximately(10, 0.1m);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -214,10 +216,11 @@ public class BudgetStatsTest : BaseTest
|
||||
var result = await _service.GetCategoryStatsAsync(BudgetCategory.Expense, referenceDate);
|
||||
|
||||
// Assert
|
||||
// 2024是闰年。1月(31) + 2月(29) + 3月(31) = 91天
|
||||
// 3660 * 91 / 366 = 910
|
||||
// 硬性预算的限额保持不变
|
||||
result.Year.Limit.Should().Be(3660);
|
||||
result.Year.Current.Should().Be(910);
|
||||
// 实际使用值根据时间计算:2024是闰年。1月(31) + 2月(29) + 3月(31) = 91天
|
||||
// 3660 * 91 / 366 ≈ 910
|
||||
result.Year.Current.Should().BeApproximately(910, 1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user