internal void ProcessPayment(User user, PaymentDetails paymentDetails) { if (!_userValidationService.ValidateUser(user)) { throw new UserInvalidException(); } _paymentGatewayObject.ProcessPayment(paymentDetails); }
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(); }