FactoryTest.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using NUnit.Framework;
  3. using Alipay.EasySDK.Payment.Common.Models;
  4. using Alipay.EasySDK.Factory;
  5. using Alipay.EasySDK.Kernel.Util;
  6. namespace UnitTest.FactoryTest
  7. {
  8. public class FactoryTest
  9. {
  10. [SetUp]
  11. public void SetUp()
  12. {
  13. Factory.SetOptions(TestAccount.Mini.CONFIG);
  14. }
  15. [Test]
  16. public void TestGetClient()
  17. {
  18. AlipayTradeFastpayRefundQueryResponse response = Factory.GetClient<Alipay.EasySDK.Payment.Common.Client>()
  19. .QueryRefund("64628156-f784-4572-9540-485b7c91b850", "64628156-f784-4572-9540-485b7c91b850");
  20. Assert.IsTrue(ResponseChecker.Success(response));
  21. Assert.AreEqual(response.Code, "10000");
  22. Assert.AreEqual(response.Msg, "Success");
  23. Assert.IsNull(response.SubCode);
  24. Assert.IsNull(response.SubMsg);
  25. Assert.NotNull(response.HttpBody);
  26. Assert.AreEqual(response.RefundAmount, "0.01");
  27. Assert.AreEqual(response.TotalAmount, "0.01");
  28. }
  29. }
  30. }