Ejemplo n.º 1
0
 public void TakesAnEndPointAndVendorName()
 {
     var request = new SagePay.Request.Payment.WebSagePayment("bob", TEST_URL, true);
     Assert.False(string.IsNullOrWhiteSpace(request.Url));
 }
Ejemplo n.º 2
0
 public void TakesAnEndPointAndSection()
 {
     var request = new SagePay.Request.Payment.WebSagePayment(SageConfiguration.CONFIG_TYPE, TEST_URL);
     Assert.False(string.IsNullOrWhiteSpace(request.Url));
 }
Ejemplo n.º 3
0
            public void TxTypeTypes(SagePay.Request.Payment.PaymentRequest.PaymentType type, string expected)
            {
                var request = new SagePay.Request.Payment.WebSagePayment(SageConfiguration.CONFIG_TYPE, TEST_URL);
                request.Transaction = PaymentRequest.SampleRequest();
                request.Transaction.TxType = type;
                var encode = request.Encode();

                Assert.Equal(encode["TxType"], expected);
            }
Ejemplo n.º 4
0
            public void ExpiryDateFormat()
            {
                var request = new SagePay.Request.Payment.WebSagePayment(SageConfiguration.CONFIG_TYPE, TEST_URL);
                request.Transaction = PaymentRequest.SampleRequest();
                var encode = request.Encode();

                Assert.Equal(string.Format("{0:MMyy}", request.Transaction.ExpiryDate),encode["ExpiryDate"]);
            }
Ejemplo n.º 5
0
            public void CurrencyTypes(Currency currency)
            {
                var request = new SagePay.Request.Payment.WebSagePayment(SageConfiguration.CONFIG_TYPE, TEST_URL);
                request.Transaction = PaymentRequest.SampleRequest();
                request.Transaction.Currency = currency;
                var encode = request.Encode();

                Assert.Equal(encode["Currency"], currency.ToString().ToUpper());
            }
Ejemplo n.º 6
0
            public void AllValuesInCollection(string key)
            {
                var request = new SagePay.Request.Payment.WebSagePayment(SageConfiguration.CONFIG_TYPE, TEST_URL);
                request.Transaction = PaymentRequest.SampleRequest();
                var encode = request.Encode();

                Assert.NotNull(encode[key]);
                Assert.False(string.IsNullOrWhiteSpace(encode[key]));
            }