Exemplo n.º 1
0
        public void PaymentIsAmount(eMoney money)
        {
            var payment           = new Payment(0);
            var paymentController = new PaymentController(_repository, _ccProcessor);
            var response          = paymentController.CreditCash(money);

            Assert.Equal(PaymentAmount.Money[money], _repository.Payment.Amount);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public void PaymentAllIsCorrect()
        {
            var               payment           = new Payment(0);
            var               paymentController = new PaymentController(_repository, _ccProcessor);
            decimal           amount            = 0;
            IHttpActionResult response          = null;

            foreach (var money in PaymentAmount.Money)
            {
                amount  += money.Value;
                response = paymentController.CreditCash(money.Key);
            }

            Assert.Equal(amount, _repository.Payment.Amount);
        }