using NUnit.Framework; using Alipay.EasySDK.Factory; using Alipay.EasySDK.Payment.Wap.Models; using Alipay.EasySDK.Kernel.Util; using System.Collections.Generic; namespace UnitTest.Payment.Wap { public class ClientTest { [SetUp] public void SetUp() { Factory.SetOptions(TestAccount.Mini.CONFIG); } [Test] public void TestPay() { AlipayTradeWapPayResponse response = Factory.Payment.Wap().Pay("iPhone6 16G", "b7f4bc7d-ea4b-4efd-9072-d8ea913c8946", "0.10", "https://www.taobao.com", "https://www.taobao.com"); Assert.IsTrue(ResponseChecker.Success(response)); Assert.IsTrue(response.Body.Contains("
")); Assert.IsTrue(response.Body.Contains("")); Assert.IsTrue(response.Body.Contains("")); } [Test] public void TestPayWithOptional() { Dictionary optionalArgs = new Dictionary { { "timeout_express", "10m" }, { "body", "iPhone6 16G"} }; AlipayTradeWapPayResponse response = Factory.Payment.Wap() .Agent("ca34ea491e7146cc87d25fca24c4cD11").BatchOptional(optionalArgs) .Pay("iPhone6 16G", "b7f4bc7d-ea4b-4efd-9072-d8ea913c8946", "0.10", "https://www.taobao.com", "https://www.taobao.com"); Assert.IsTrue(ResponseChecker.Success(response)); Assert.IsTrue(response.Body.Contains("")); Assert.IsTrue(response.Body.Contains("")); Assert.IsTrue(response.Body.Contains("")); } } }