コード例 #1
0
        public void RequestBeyondLimit()
        {
            var    cardNumber = "5115490833902574";
            string token      = string.Empty;
            var    sut        = new TransactionProcessor(_gateway);

            sut.PerformFullCreditProcess(cardNumber, 500m, out token);

            Assert.Equal(string.Empty, token);
        }
コード例 #2
0
        public void CreditAvailableTest()
        {
            var    cardNumber = "4800037508664675";
            string token      = string.Empty;
            var    sut        = new TransactionProcessor(_gateway);

            sut.PerformFullCreditProcess(cardNumber, 500m, out token);

            Assert.NotEqual(string.Empty, token);
        }
コード例 #3
0
        public void InvalidNumberTest()
        {
            var    cardNumber = "42";
            string token      = string.Empty;
            var    sut        = new TransactionProcessor(_gateway);

            sut.PerformFullCreditProcess(cardNumber, 500m, out token);

            Assert.Equal(string.Empty, token);
        }
コード例 #4
0
        public void CreditAvailableButReservedTest()
        {
            var    cardNumber = "4836803436404398198";
            string token      = string.Empty;

            _gateway.ReserveCredit(cardNumber, 500m);
            var sut = new TransactionProcessor(_gateway);

            sut.PerformFullCreditProcess(cardNumber, 500m, out token);

            Assert.Equal(string.Empty, token);
        }
コード例 #5
0
        public void CreditNotAvailableTest()
        {
            var    cardNumber = "342844743236943";
            string token      = string.Empty;

            _gateway.CompleteTransaction(cardNumber,
                                         _gateway.ReserveCredit(cardNumber, 500m));
            var sut = new TransactionProcessor(_gateway);

            sut.PerformFullCreditProcess(cardNumber, 500m, out token);

            Assert.Equal(string.Empty, token);
        }