예제 #1
0
        public void Test_IBox_Pay_Return_Right_Action_Result()
        {
            //arrange
            IBoxPayMethod payMethod = new IBoxPayMethod();

            //act
            var result = payMethod.Pay(model);

            //assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
예제 #2
0
 public object BindModel( ControllerContext controllerContext, ModelBindingContext bindingContext )
 {
     var payType = controllerContext.RouteData.Values["payType"].ToString();
     IPayMethod payMethod = null;
     switch (payType)
     {
         case "Bank":
             payMethod = new BankPayMethod();
             break;
         case "IBox":
             payMethod = new IBoxPayMethod();
             break;
         case "Visa":
             payMethod = new VisaPayMethod();
             break;
     }
     return payMethod;
 }