refactor(swap): 合并多空名义本金参数为单一 posiTotalNotional 并加固测试
- DealInterests 的 posiLongNotionalValue + posiShortNotionalValue 合并为 posiTotalNotional(调用点以 posiLongNotional+posiShortNotional 求和传入),净减一个参数 - SwapDealService / SwapEodPositionService / InterestCalcRequest 同步收敛多空死管道参数 - 19 个测试调用点适配新签名 - SwapEodPositionServiceIntegrationTest 参数计数断言由裸数字改为参数名集合断言(CollectionAssert.AreEquivalent,对增删/重排/改名敏感)
This commit is contained in:
@@ -119,7 +119,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var position = CreateInterestPosition();
|
||||
var interests = service.GetInterests(td, td.trade_extend, unwindDate, unwindDate,
|
||||
new List<eod_swap_position>(), new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
add: false, settment: false, newCalcLast: false);
|
||||
return interests.Count > 0 ? interests[0].InterestAmount : 0m;
|
||||
@@ -142,7 +142,7 @@ namespace YLErp.Modules.SwapModule
|
||||
};
|
||||
var interests = service.GetInterests(td, td.trade_extend, valueDate, valueDate,
|
||||
new List<eod_swap_position> { preEod }, new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
add: false, settment: true, newCalcLast: false);
|
||||
if (interests.Count == 0) return (0m, 0m);
|
||||
@@ -313,7 +313,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var svc5 = new StubDealService(0m, floatRate: 0.001);
|
||||
var i5 = svc5.GetInterests(td, td.trade_extend, day5, day5,
|
||||
new List<eod_swap_position>(), new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
settment: false);
|
||||
decimal swap1 = i5.Count > 0 ? i5[0].InterestAmount : 0m;
|
||||
@@ -322,7 +322,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var svc10 = new StubDealService(swap1, floatRate: 0.001);
|
||||
var i10 = svc10.GetInterests(td, td.trade_extend, day10, day10,
|
||||
new List<eod_swap_position>(), new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
settment: false);
|
||||
decimal swap2 = i10.Count > 0 ? i10[0].InterestAmount : 0m;
|
||||
@@ -332,7 +332,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var svc15 = new StubDealService(totalConsumed, floatRate: 0.001);
|
||||
var i15 = svc15.GetInterests(td, td.trade_extend, day15, day15,
|
||||
new List<eod_swap_position>(), new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
settment: false);
|
||||
decimal finalUnwind = i15.Count > 0 ? i15[0].InterestAmount : 0m;
|
||||
@@ -362,7 +362,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var svc = new StubDealService(0m, floatRate: 0.001);
|
||||
var interests = svc.GetInterests(td, td.trade_extend, unwindDate, unwindDate,
|
||||
new List<eod_swap_position>(), new List<swap_position> { position },
|
||||
Principal, Principal, Principal, Principal, 1m,
|
||||
Principal, Principal, 1m,
|
||||
(int)SwapEventTypeEnum.平仓, false, Principal,
|
||||
settment: false);
|
||||
return interests.Count > 0 ? interests[0].InterestAmount : 0m;
|
||||
|
||||
Reference in New Issue
Block a user