From 09660fffea3a7588aa6dda3f510800cc20f10928 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 20 Aug 2026 13:37:26 +0800 Subject: [PATCH] =?UTF-8?q?test(swap):=20EQD-6977=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=87=91=E6=A0=87=E5=87=86=E6=B5=8B=E8=AF=95=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=88=A0=E9=99=A4CalcPenalty=20valueDate=E5=85=B7=E5=90=8D?= =?UTF-8?q?=E5=AE=9E=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Penalty/SwapPenaltyInterestCalculatorTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UnitTestProject/Modules/SwapModule/Penalty/SwapPenaltyInterestCalculatorTest.cs b/UnitTestProject/Modules/SwapModule/Penalty/SwapPenaltyInterestCalculatorTest.cs index ed053ddc..a630595f 100644 --- a/UnitTestProject/Modules/SwapModule/Penalty/SwapPenaltyInterestCalculatorTest.cs +++ b/UnitTestProject/Modules/SwapModule/Penalty/SwapPenaltyInterestCalculatorTest.cs @@ -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(承接量不产生利息)"); } }