test(swap): EQD-6977 同步金标准测试——删除CalcPenalty valueDate具名实参

This commit is contained in:
hjhan
2026-08-20 13:37:26 +08:00
parent 48ae429fb8
commit 09660fffea
@@ -74,7 +74,7 @@ namespace UnitTestProject.Modules.SwapModule.Penalty
capitalizedInterest: capitalized, carryInInterest: carryIn,
frozenRate: FundingLegRate.Fixed(Rate),
policy: Policy(p), resetAnchor: StartDate,
eventType: (int)SwapEventTypeEnum., valueDate: UnwindDate);
eventType: (int)SwapEventTypeEnum.);
[TestMethod]
public void _复利_全期等于已结加罚息()
@@ -121,7 +121,7 @@ namespace UnitTestProject.Modules.SwapModule.Penalty
frozenRate: FundingLegRate.Fixed(Rate),
policy: Policy(CreatePosition(InterestTypeEnum., SwapDirectionEnum.)),
resetAnchor: StartDate,
eventType: (int)SwapEventTypeEnum., valueDate: UnwindDate);
eventType: (int)SwapEventTypeEnum.);
var expected = Rate * Notional * 6m / AnnualDays;
Assert.AreEqual((double)expected, (double)e.InterestAmount, 0.0001, "6 天 = 8/26..8/31");
@@ -149,7 +149,7 @@ namespace UnitTestProject.Modules.SwapModule.Penalty
capitalizedInterest: 0m, carryInInterest: 0m,
frozenRate: FundingLegRate.Fixed(Rate),
policy: Policy(p), resetAnchor: StartDate,
eventType: (int)SwapEventTypeEnum., valueDate: UnwindDate);
eventType: (int)SwapEventTypeEnum.);
var expected = Rate * Notional * days / AnnualDays;
Assert.AreEqual((double)expected, (double)e.InterestAmount, 0.0001,
$"settled={settled}, calcLast={calcLast} → {days} 天");
@@ -184,7 +184,7 @@ namespace UnitTestProject.Modules.SwapModule.Penalty
frozenRate: FundingLegRate.Fixed(Rate),
policy: Policy(CreatePosition(InterestTypeEnum., SwapDirectionEnum.)),
resetAnchor: StartDate,
eventType: (int)SwapEventTypeEnum., valueDate: UnwindDate);
eventType: (int)SwapEventTypeEnum.);
Assert.AreEqual(SwapPenaltyInterestCalculator.PenaltyEventReason, e.EventReason, "事件原因=罚息");
Assert.AreEqual((int)SwapEventTypeEnum., e.EventType, "事件类型=平仓(下游聚合无差别)");
@@ -206,7 +206,7 @@ namespace UnitTestProject.Modules.SwapModule.Penalty
frozenRate: FundingLegRate.Fixed(Rate),
policy: Policy(CreatePosition(InterestTypeEnum., SwapDirectionEnum.)),
resetAnchor: StartDate,
eventType: (int)SwapEventTypeEnum., valueDate: MaturityDate);
eventType: (int)SwapEventTypeEnum.);
Assert.AreEqual(0m, e.InterestAmount, "平仓日=到期日无剩余期限,罚息为 0(承接量不产生利息)");
}
}