diff --git a/UnitTestProject/Modules/SwapModule/GLMS20260817Fr007UnwindMorningTest.cs b/UnitTestProject/Modules/SwapModule/GLMS20260817Fr007UnwindMorningTest.cs index 57360ea2..c326d7fc 100644 --- a/UnitTestProject/Modules/SwapModule/GLMS20260817Fr007UnwindMorningTest.cs +++ b/UnitTestProject/Modules/SwapModule/GLMS20260817Fr007UnwindMorningTest.cs @@ -486,6 +486,28 @@ namespace YLErp.Modules.SwapModule Assert.IsTrue(o.Threw, "EOD 不算尾(10)+非到期重置日(7/20)缺价 → 仍应拦截(ByEod 取价链,真实依赖)"); StringAssert.Contains(o.Ex.Message, "FR007"); } + + // ── 到期日当天全平:replayEndDate=endDate+1 补计分支(relaxedFixingFromDate 的存在理由)── + // 不算尾时 InitInterestDate 把 endDate 回拨一天;最终全平的历史差分重放需把窗口补回真实 + // 平仓/到期日(replayEndDate=endDate+1),但该边界日的定盘经 relaxedFixingFromDate 标记为 + // "有价则取/缺价跳过"——否则到期日上午全平会被尾日价误拦(EQD-6968 在到期日的镜像场景)。 + + [TestMethod] + public void FinalClose_OnMaturityDay_NoTail_CloseDayFr007Missing_Succeeds() + { + AssertNoThrow(Run(InterestTypeEnum.复利, includeCloseDate: false, calcMode: "10", + exerciseDate: CloseDate, preEod: BuildPreEod(new DateTime(2026, 7, 13))), + "到期日当天全平+不算尾+到期日(重置日)缺价 → 应放行(补计重放的边界日不索取定盘)"); + } + + [TestMethod] + public void Guard_FinalClose_OnMaturityDay_Tail_CloseDayFr007Missing_StillThrows() + { + var o = Run(InterestTypeEnum.复利, includeCloseDate: false, calcMode: "11", + exerciseDate: CloseDate, preEod: BuildPreEod(new DateTime(2026, 7, 13))); + Assert.IsTrue(o.Threw, "到期日当天全平+算尾+到期日缺价 → 应拦截(该日利率被消费)"); + StringAssert.Contains(o.Ex.Message, "FR007"); + } } }