从山证v2.3.0拷贝
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using Newtonsoft.Json;
|
||||
using YLErp.BLL.EodSettlement;
|
||||
|
||||
namespace YLErp.Modules.EodModule.QueryModule
|
||||
{
|
||||
[TestClass]
|
||||
public class TestEodTradePositionApiService
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestInfoAll()
|
||||
{
|
||||
var req = new EodSettleInfoRequest
|
||||
{
|
||||
ValueDate = new DateTime(2022, 1, 4)
|
||||
};
|
||||
var context = new EodSettleInfoQueryContext(OptUserInfo.SystemUser);
|
||||
|
||||
var positionResult = new EodTradePositionApiService(context).GetEodPositions(req);
|
||||
var closeResult = new EodCloseInfoQueryService(context).GetEodCloseInfoList(req.ValueDate);
|
||||
|
||||
var clientIds = context.GetClientIds();
|
||||
|
||||
var balanceResult = ClientBalanceUtility.GetClientBanlances(
|
||||
clientIdList: clientIds,
|
||||
startDate: DateTime.MinValue,
|
||||
endDate: req.ValueDate,
|
||||
IsGetOuterMarginGap: false,
|
||||
IsClientBalanceGap: false,
|
||||
ParentFlag: false,
|
||||
clientDataSource: context);
|
||||
|
||||
var result = new
|
||||
{
|
||||
positionResult.OptionPositions,
|
||||
positionResult.SwapPositions,
|
||||
positionResult.ForwardPositions,
|
||||
CloseInfos = closeResult,
|
||||
AccountInfos = balanceResult
|
||||
};
|
||||
|
||||
//var result = new { d = 1.2222222255555555555 };
|
||||
|
||||
var serializeSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
serializeSettings.Converters ??= new List<JsonConverter>();
|
||||
serializeSettings.Converters.Add(new DoubleJsonWriteConverter(2, 8));
|
||||
|
||||
var json = JsonConvert.SerializeObject(result, serializeSettings);
|
||||
|
||||
Assert.IsNotNull(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user