示例#1
0
 internal void ProcessPayment(User user, PaymentDetails paymentDetails)
 {
     if (!_userValidationService.ValidateUser(user))
     {
         throw new UserInvalidException();
     }
     _paymentGatewayObject.ProcessPayment(paymentDetails);
 }
示例#2
0
        public void SetUp()
        {
            _userValidationException = null;
            _userValidationService   = new Mock <IUserValidationService>();
            _paymentGateway          = new Mock <IPaymentGateway>();

            _paymentService = new PaymentService(_userValidationService.Object, _paymentGateway.Object);
            _user           = new User();
            _paymentDetails = new PaymentDetails();
        }