Esempio n. 1
0
            public void ShouldSetTheCurrencyCodeTypeToPHP()
            {
                var model = PayPalDGModel.Create()
                            .WithCurrencyCode(CurrencyCodeType.PHP);

                Assert.AreEqual(CurrencyCodeType.PHP, model.CurrencyCodeType);
            }
Esempio n. 2
0
            public void ShouldSetTheTaxTotalAmountTo15()
            {
                var model = PayPalDGModel.Create()
                            .WithTaxTotalAmountOf(15);

                Assert.AreEqual(15, model.TaxTotalAmount);
            }
Esempio n. 3
0
            public void ShouldBeAbleToSetToFalse()
            {
                var model = PayPalDGModel.Create()
                            .IncludeSupportForCreditCardPayment(false);

                Assert.IsFalse(model.SupportCreditCardPayment);
            }
Esempio n. 4
0
            public void WithOneParameter()
            {
                var model = PayPalDGModel.Create()
                            .WithAdditionalCallbackParams(new List <PayPalDGAdditionalCallbackParam>
                {
                    new PayPalDGAdditionalCallbackParam {
                        Name = "p1", Value = "v1"
                    }
                });

                Assert.AreEqual("?p1=v1", model.BuildAdditionalCallbackParams());
            }
Esempio n. 5
0
            public void ShouldReturnTheTotalItemAmount()
            {
                var model = PayPalDGModel.Create()
                            .WithProductItems(new List <PayPalDGProductItem>
                {
                    new PayPalDGProductItem {
                        Amount = 15.22m
                    },
                    new PayPalDGProductItem {
                        Amount = 11.01m
                    }
                });

                Assert.AreEqual(26.23m, model.GetItemTotalAmount());
            }
Esempio n. 6
0
 public void ShouldThrowPayPalDGExceptionWhenPassing0Item()
 {
     PayPalDGModel.Create().WithProductItems(new List <PayPalDGProductItem>());
 }
Esempio n. 7
0
 public void ShouldThrowPayPalDGExceptionWhenPassingNullItems()
 {
     PayPalDGModel.Create().WithProductItems(null);
 }
Esempio n. 8
0
            public void ShouldSetTheCallbackUrl()
            {
                var model = PayPalDGModel.Create().WithCancelCallbackUrl("http://localhost:1234/test");

                Assert.AreEqual("http://localhost:1234/test", model.CancelCallbackUrl);
            }
Esempio n. 9
0
 public void ShouldThrowPayPalDGExceptionWhenPassingInvalidUrl()
 {
     PayPalDGModel.Create().WithCancelCallbackUrl("/test/url");
 }
Esempio n. 10
0
            public void ShouldSetTheSupportForCreditCardPaymentToTrue()
            {
                var model = PayPalDGModel.Create();

                Assert.IsTrue(model.SupportCreditCardPayment);
            }
Esempio n. 11
0
 public void ShouldThrowPayPalDGExceptionWhenNoCallbackUrlSpecified()
 {
     PayPalDGModel.Create().WithCancelCallbackUrl(null);
 }
Esempio n. 12
0
 public void ShouldThrowPayPalDGExceptionWhenPassingInvalidUrl()
 {
     PayPalDGModel.Create().WithDoExpressCheckoutCallbackUrl("/test/url");
 }
Esempio n. 13
0
 public void ShouldThrowPayPalDGExceptionWhenNoCallbackUrlSpecified()
 {
     PayPalDGModel.Create().WithDoExpressCheckoutCallbackUrl(null);
 }