public void payRequestHelpForTestCase2Test()
 {
     var rId = "test2";
     var bankPara = new BankParaWarp { ProcessTime = 5500, Result = "failed" };
     var creatBillPara = new createBillParaWarp { Method = payMethod.sync, BankPara = bankPara };
     var testPara = new testParameter { ReqId = rId, WaitTime = 5000, CreatBillPara = creatBillPara };
     var test = new inTimePayControllerHelpController();
     var res = test.payRequestHelpForTest(rId, testPara);
     Assert.IsTrue(res == null);
 }
 public void payRequestHelpForTestCase3Test()
 {
     var rId = "test3";
     var bankPara = new BankParaWarp { ProcessTime = 2000, Result = string.Empty };
     var creatBillPara = new createBillParaWarp { Method = payMethod.async, BankPara = bankPara };
     var testPara = new testParameter { ReqId = rId, WaitTime = 5000, CreatBillPara = creatBillPara };
     var test = new inTimePayControllerHelpController();
     var res = test.payRequestHelpForTest(rId, testPara);
     var assR = new inTimeRes { PaymentResult = string.Empty, PayMethod = payMethod.async };
     Assert.AreEqual(res.PaymentResult, assR.PaymentResult);
     Assert.AreEqual(res.PayMethod, assR.PayMethod);
 }
Example #3
0
 public paymentEntity createBillHelpForTest(createBillParaWarp createBillPara)//inTimeReqPara para, payMethod method = payMethod.sync, int processTime = 2000, string result = "ok")
 {
     return new paySOA().realCreateBill(createBillPara.Para, (be, pt, rt) =>
     {
         var forBank = new BankParaWarp { BankEentity = be, ProcessTime = pt, Result = rt };
         using (var client = new HttpClient())
         {
             client.BaseAddress = new Uri("http://win8dev");
             client.DefaultRequestHeaders.Accept.Add(
                 new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
             var resp = client.PostAsJsonAsync("inTimePayment/api/bank/processPaymentHelpForTest", forBank).Result;
             var resContent = resp.Content.ReadAsAsync<string>();
             //using (var req = new BankServiceClient())
             //{
             //    req.processPaymentHelp(be);
             //}
             ////using (var req = new PaymentServiceClient())
             //{
             //    req.paymentResultHookHelp(res);
             //}
         }
     }, createBillPara.Method, createBillPara.BankPara.ProcessTime, createBillPara.BankPara.Result);
 }
Example #4
0
 public void processPaymentHelpForTest(BankParaWarp bankPara)
 {
     new bank().realProcessPaymentHelp(bankPara.BankEentity, bankPara.ProcessTime, bankPara.Result);
 }