UnitTest1.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Microsoft.Extensions.Logging;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using System.Threading.Tasks;
  4. using XYY.Service.Standard.ChannelApi.Winit.LMAApi;
  5. using XYY.Model.Standard.Order;
  6. using XYY.Model.Standard.Channel;
  7. using System.IO;
  8. namespace XYY.Test
  9. {
  10. [TestClass]
  11. public class UnitTest1
  12. {
  13. [TestMethod]
  14. public async Task TestMethod1()
  15. {
  16. //LMAApi api = new LMAApi(null);
  17. // await api.GetData();
  18. // var order = new Order_Order
  19. // {
  20. // ReceiverStreet = "26767 Paddington Court",
  21. // ReceiverCity = "Murrieta",
  22. // ReceiverCountryCode = "US",
  23. // ReceiverName = "Ruth Cepeda",
  24. // ReceiverPhone = "+8169778412",
  25. // SystemNo = "JFKTest03",
  26. // CustomerWeight = 440,
  27. // ReceiverState = "CA",
  28. // ReceiverZipCode = "92563",
  29. // CustomerOrderNo = "T0000001"
  30. // };
  31. // var goods = new System.Collections.Generic.List<Order_OrderGoods> {
  32. // new Order_OrderGoods{
  33. // CnName="Æ»¹ûÊÖ»ú12345",
  34. // DeclareFee=1,
  35. // DeclareCurrency="USD",
  36. // EnName="ihpone",
  37. // Quantity=1,
  38. // HsCode="3924100090"
  39. // }
  40. //};
  41. // var channel = new Logistics_Channel
  42. // {
  43. // SenderStreet = "JFK"
  44. // };
  45. // var result = await api.DataUpload(order, goods, channel);
  46. // var data = await api.DrawPdfLabel(result, channel, order, goods);
  47. // string basePath = System.AppContext.BaseDirectory;
  48. // string pdfPath = Path.Combine(basePath, "test.pdf");
  49. // File.WriteAllBytes(pdfPath, data);
  50. //System.Diagnostics.Process.Start(pdfPath);
  51. }
  52. }
  53. }