test: 修复预存在测试失败-AddClientCashInCashOut no-op override + FR007取价失败兜底
- TestableSwapEodPositionService: override AddClientCashInCashOut 与 AddClientCash 同构 no-op,修复6个AS_*测试客户信息未找到异常 - GLMS20260805ClosePercentDiffDiagnoseTest: FR007取价失败走 Inconclusive(与连不上库同语义,外部数据依赖不应判为测试失败) AS_* 仍有深层失败(自动互换未触发,interestList=0),属预存在的测试数据问题,需单独排查
This commit is contained in:
@@ -246,8 +246,19 @@ namespace YLErp.Modules.SwapModule
|
||||
var valueDate = DateTime.Today;
|
||||
var unwindDate = DateTime.Today;
|
||||
|
||||
var interests100 = new SwapDealService(user).GetUnwindInterests(valueDate, unwindDate, td.id, cp100_B, (int)SwapEventTypeEnum.平仓);
|
||||
var interests40 = new SwapDealService(user).GetUnwindInterests(valueDate, unwindDate, td.id, cp40_B, (int)SwapEventTypeEnum.平仓);
|
||||
// FR007 fixing 是外部数据依赖:非交易日/数据未发布时取价会抛 Exception。
|
||||
// 与"连不上库自动 Inconclusive"同语义——外部数据不可用不应判为测试失败。
|
||||
List<swap_flow_event> interests100, interests40;
|
||||
try
|
||||
{
|
||||
interests100 = new SwapDealService(user).GetUnwindInterests(valueDate, unwindDate, td.id, cp100_B, (int)SwapEventTypeEnum.平仓);
|
||||
interests40 = new SwapDealService(user).GetUnwindInterests(valueDate, unwindDate, td.id, cp40_B, (int)SwapEventTypeEnum.平仓);
|
||||
}
|
||||
catch (Exception ex) when (ex.Message.Contains("获取不到") && ex.Message.Contains("价格"))
|
||||
{
|
||||
Assert.Inconclusive($"FR007 fixing 数据不可用({valueDate:yyyy-MM-dd} 非交易日或数据未发布):{ex.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
PrintInterestComparison(interests100, interests40, cp100_B, cp40_B);
|
||||
}
|
||||
|
||||
@@ -83,5 +83,16 @@ namespace YLErp.Modules.SwapModule
|
||||
ClientCashCalls.Add((amount, action));
|
||||
return _nextId++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AddClientCashInCashOut 生产实现会查 DataCacheProvider.GetClientDataSource().GetData(ClientId),
|
||||
/// 纯内存测试无客户缓存会抛"客户信息未找到"。与 AddClientCash 同构 no-op,
|
||||
/// 仅捕获调用记录,供断言使用。
|
||||
/// </summary>
|
||||
public override int AddClientCashInCashOut(OtcTradeBase td, double amount, string action, DateTime valueDate)
|
||||
{
|
||||
ClientCashCalls.Add((amount, action));
|
||||
return _nextId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user