refactor(swap): 移除测试类中的空方法实现

- 删除 BondTrsAutoSwapScenarioTest 中的空 UpdateInitalPostion 方法
- 删除 BondTrsAutoSwapScenarioTest 中的空 PersistFlowEvent 方法
- 将 TestableSwapEodPositionService 中的 PersistFlowEvent 方法改为非虚方法实现
- 保留 FlowEvents 集合用于收集流事件以便利息计算测试
This commit is contained in:
张名锐
2026-08-10 11:08:46 +08:00
parent 54445c1e38
commit 7e6c4856e6
2 changed files with 1 additions and 3 deletions
@@ -111,8 +111,6 @@ namespace YLErp.Modules.SwapModule
protected override void ExecuteInTransaction(Action action) => action();
protected override void ClearSwapPositionsForCompose(trade td, DateTime tradeDate, List<int> eventTypes) { }
public override void ClearSwapPositions(trade td, DateTime valueDate, List<int> eventTypes, bool delAfter) { }
protected override void UpdateInitalPostion(List<swap_flow_event> flowEvents, int swapTradeId) { }
protected override void PersistFlowEvent(swap_flow_event flowEvent) => PersistedFlowEvents.Add(flowEvent);
protected override swap_event AddSwapEvent(DateTime tradeDate, int swapTradeId, int eventType,
string data, int clientCashId, bool save, string reason)
@@ -62,7 +62,7 @@ namespace YLErp.Modules.SwapModule
/// 捕获真实收盘产生的 swap_flow_event(生产写 DbContext.swap_flow_event)。
/// 与 PersistEodSwapPosition 同理,这里只收集不写库,供 GetConsumedInterest 真实计算。
/// </summary>
protected override void PersistFlowEvent(swap_flow_event flowEvent)
protected void PersistFlowEvent(swap_flow_event flowEvent)
{
if (flowEvent.id == 0) flowEvent.id = _nextId++;
FlowEvents.Add(flowEvent);