refactor(swap): 合并多空名义本金参数为单一 posiTotalNotional 并加固测试
- DealInterests 的 posiLongNotionalValue + posiShortNotionalValue 合并为 posiTotalNotional(调用点以 posiLongNotional+posiShortNotional 求和传入),净减一个参数 - SwapDealService / SwapEodPositionService / InterestCalcRequest 同步收敛多空死管道参数 - 19 个测试调用点适配新签名 - SwapEodPositionServiceIntegrationTest 参数计数断言由裸数字改为参数名集合断言(CollectionAssert.AreEquivalent,对增删/重排/改名敏感)
This commit is contained in:
@@ -59,7 +59,7 @@ namespace UnitTestProject.Modules.SwapModule
|
||||
protected override List<swap_flow_event> CalcSwapInterests(
|
||||
trade td, trade_extend tradeExtend, DateTime valueDate, DateTime unwindDate,
|
||||
List<eod_swap_position> eodPositions, List<swap_position> positions,
|
||||
decimal posiNotionalValue, decimal posiLongNotionalValue, decimal posiShortNotionalValue,
|
||||
decimal posiNotionalValue,
|
||||
decimal closePosiNotionalValue, decimal closePrecent, int eventType, bool tdClose,
|
||||
decimal orginPv, bool add = false, bool settment = true, bool newCalcLast = false,
|
||||
List<swap_flow_event> closeList = null)
|
||||
@@ -67,7 +67,7 @@ namespace UnitTestProject.Modules.SwapModule
|
||||
var svc = new StubSwapDealService(
|
||||
new OptUserInfo(0, nameof(SwapSingleTradeVerificationTest), OptUserFrom.UnitTest), _floatRates);
|
||||
return svc.GetInterests(td, tradeExtend, valueDate, unwindDate,
|
||||
eodPositions, positions, posiNotionalValue, posiLongNotionalValue, posiShortNotionalValue,
|
||||
eodPositions, positions, posiNotionalValue,
|
||||
closePosiNotionalValue, closePrecent, eventType, tdClose,
|
||||
orginPv, add, settment, newCalcLast, closeList);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace UnitTestProject.Modules.SwapModule
|
||||
List<swap_flow_event> flowEvents, decimal closeNotional, eod_swap_position prevEod)
|
||||
{
|
||||
SaveAutoEodWithCloseInterestPosition(prevEod, null, position, td, valueDate, null,
|
||||
posiLongNotional, posiShortNotional, flowEvents, closeNotional, false, 1m,
|
||||
posiLongNotional + posiShortNotional, flowEvents, closeNotional, false, 1m,
|
||||
posiLongNotional + posiShortNotional);
|
||||
return PersistedPositions.LastOrDefault();
|
||||
}
|
||||
@@ -213,7 +213,7 @@ namespace UnitTestProject.Modules.SwapModule
|
||||
var interests = svc.GetInterests(
|
||||
td, td.trade_extend, valueDate, valueDate,
|
||||
prevEod, new List<swap_position> { position },
|
||||
closeNotional, closeNotional, 0m, closeNotional, 1m,
|
||||
closeNotional, closeNotional, 1m,
|
||||
(int)SwapEventTypeEnum.平仓,
|
||||
false, closeNotional, false, settment: false, newCalcLast: isMaturity);
|
||||
Assert.AreEqual(1, interests.Count);
|
||||
|
||||
Reference in New Issue
Block a user