SaveDataAppServiceTest.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using OrBit.MESInterface.Application.Contracts.Interfaces;
  2. using Shouldly;
  3. using System.Threading.Tasks;
  4. using Xunit;
  5. namespace OrBit.MESInterface.Application.Tests.UnitTests
  6. {
  7. public class SaveDataAppServiceTest : MESInterfaceApplicationTestBase
  8. {
  9. private readonly IDownloadDataAppService _downloadDataAppService;
  10. public SaveDataAppServiceTest()
  11. {
  12. _downloadDataAppService = GetRequiredService<IDownloadDataAppService>();
  13. }
  14. [Fact]
  15. public async Task Should_SaveData_By_Single()
  16. {
  17. // var result = await _downloadDataAppService.SingleInterfaceDownload("SAPDataDownload", "READ_MATERIAL", "IM_WERKS=2000,IM_BEGDA=2020-04-01 00:00:00,2021-05-01 00:00:00");
  18. // var result= await _saveDataAppService.SataData("READ_MATERIAL", resultjson);
  19. // result.code.ShouldBe(Contracts.Dtos.AnalyticState.SaveTooBusinessTableSuccess);
  20. //resultjson.ShouldContain("EX_LINES");
  21. //JObject jobj = JObject.Parse(resultjson);
  22. //JToken result = jobj as JToken;
  23. ////这里6.0版块可以用正则匹配
  24. //var node = result.SelectToken("$.." + "EX_LINES");
  25. //var value = "";
  26. //if (node != null)
  27. //{
  28. // //判断节点类型
  29. // if (node.Type == JTokenType.String || node.Type == JTokenType.Integer || node.Type == JTokenType.Float)
  30. // {
  31. // //返回string值
  32. // value = node.Value<object>().ToString();
  33. // }
  34. //}
  35. //int.Parse(value).ShouldBeGreaterThan(-1);
  36. }
  37. }
  38. }