Merge branch 'glms/feature/1.4.2-0806' into glms/feature/1.4.2
This commit is contained in:
@@ -166,6 +166,35 @@ namespace YLErp.Modules.SwapModule
|
||||
Console.WriteLine($"UW_005: 反序列化SwapRealizedPnL=8000, 资金流水={service.ClientCashCalls[0].amount}, TradeStatus={td.TradeStatus} ✅");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void UW_005A_ApproveSwapTrade_互换审核_不返还预付金本金()
|
||||
{
|
||||
var td = SwapDealTestFactory.CreateTrade();
|
||||
td.ExerciseDate = new DateTime(2026, 12, 31);
|
||||
var unwindData = SwapDealTestFactory.CreateUnwindData(
|
||||
swapRealizedPnL: 100m, swapMarginAmount: -10000m);
|
||||
var swapEvent = new swap_event
|
||||
{
|
||||
id = 2,
|
||||
SwapTradeId = SwapDealTestFactory.SwapTradeId,
|
||||
EventType = (int)SwapEventTypeEnum.互换,
|
||||
Invalid = false,
|
||||
EventData = JsonConvert.SerializeObject(unwindData)
|
||||
};
|
||||
var service = new TestableSwapDealService(td,
|
||||
swapEvents: new Dictionary<int, swap_event>
|
||||
{
|
||||
[(int)SwapEventTypeEnum.互换] = swapEvent
|
||||
});
|
||||
|
||||
service.ApproveSwapTrade(td, (int)SwapEventTypeEnum.互换);
|
||||
|
||||
Assert.AreEqual(1, service.ClientCashCalls.Count, "互换审批只应生成互换结算流水");
|
||||
Assert.AreEqual(ClientCashInCashOut.系统操作_互换, service.ClientCashCalls[0].action);
|
||||
Assert.IsFalse(service.ClientCashCalls.Any(x => x.action == ClientCashInCashOut.系统操作_应付预付金),
|
||||
"互换审批不应生成应付预付金流水");
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
// 场景6:ApplySwapTrade 提交审核 —— 前置校验与保存事件
|
||||
// ================================================================
|
||||
|
||||
Reference in New Issue
Block a user