从山证v2.3.0拷贝
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using CsvHelper;
|
||||
using YLErp.Modules.IntegrationModule.XiaMenXiangYu;
|
||||
|
||||
namespace YLErp.Modules.IntegrationModule
|
||||
{
|
||||
[TestClass]
|
||||
public class TestJinshidaEodTradeSyncService : UnitTestBase
|
||||
{
|
||||
[TestMethod]
|
||||
public void Test1()
|
||||
{
|
||||
var json = ReadResourceFile("IntegrationModule\\jinshida_1.json");
|
||||
|
||||
var result = JsonHelper.Deserialize<JinshidaEodTradeResponse>(json);
|
||||
|
||||
Assert.IsTrue(result.rows.Any());
|
||||
|
||||
foreach (var item in result.rows)
|
||||
{
|
||||
var message = new JinshidaEodTradeSyncService(OptUserInfo.SystemUser, Program.GetService<IHttpClientFactory>())
|
||||
.SaveExchangeTrade(item);
|
||||
|
||||
Assert.AreEqual(message, "成功");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Test2()
|
||||
{
|
||||
var _now = DateTime.Now;
|
||||
var fileName = _now.ToString("yyyy_MM_dd_HH_mm");
|
||||
var jsdPath = Path.Combine(AppContext.BaseDirectory, "log\\jsd");
|
||||
Directory.CreateDirectory(jsdPath);
|
||||
var csvPath = Path.Combine(jsdPath, fileName + ".csv");
|
||||
using var writer = new StreamWriter(csvPath, false, System.Text.Encoding.UTF8);
|
||||
using var csv = new CsvWriter(writer, System.Globalization.CultureInfo.InvariantCulture);
|
||||
csv.WriteRecords(Enumerable.Empty<JinshidaEodTradeFields>());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user