test(swap): EQD-6968 补到期日当天全平补计分支——replayEndDate+1 的尾日取价豁免
relaxedFixingFromDate 的存在理由回归钉死:不算尾时 InitInterestDate 回拨 endDate 一天,最终全平的历史差分重放需补回真实平仓日(replayEndDate=endDate+1), 该边界日定盘经 relaxedFixingFromDate 走"有价则取/缺价跳过"—— 否则到期日上午全平被尾日价误拦(EQD-6968 在到期日当天的镜像场景)。 - FinalClose_OnMaturityDay_NoTail_...Succeeds:不算尾+到期日缺价 → 放行 - Guard_FinalClose_OnMaturityDay_Tail_...StillThrows:算尾+到期日缺价 → 仍拦 注:全平重放分支 relaxedFixingFromDate 恒非 null(Red_Compound_FullClose_WithPreEod 已覆盖),本提交补的是 endDate<valueDate 时的 +1 补计子分支。 验证:GLMS20260817Fr007UnwindMorningTest 30/30 内存全绿
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user