Exemple #1
0
        public void DebitIsSuccessful()
        {
            var paymentController = new PaymentController(_repository, _ccProcessor);
            var payment           = new Payment(0);
            var response          = paymentController.CreditCash(eMoney.eOneDollar);

            Assert.Equal(PaymentAmount.Money[eMoney.eOneDollar], _repository.Payment.Amount);

            response = paymentController.DebitCash(eMoney.eOneDollar);

            Assert.Equal(0, _repository.Payment.Amount);
        }
Exemple #2
0
        public void DebitNegativePaymentNotAllowed()
        {
            var payment           = new Payment(0);
            var paymentController = new PaymentController(_repository, _ccProcessor);
            var response          = paymentController.DebitCash(eMoney.eDime);

            var contentResult = response as NegotiatedContentResult <string>;

            Assert.NotNull(contentResult);
            Assert.NotNull(contentResult.Content);
            Assert.Equal("Negative payment is not allowed", contentResult.Content);
        }