Пример #1
0
        public void Test_Visa_Pay_Right_Type_Of_Action_Result()
        {
            //arrange
            VisaPayMethod payMethod = new VisaPayMethod();

            //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;
 }