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

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

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

                Assert.IsFalse(model.SupportCreditCardPayment);
            }
Exemple #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());
            }
Exemple #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());
            }
Exemple #6
0
 public void ShouldThrowPayPalDGExceptionWhenPassing0Item()
 {
     PayPalDGModel.Create().WithProductItems(new List <PayPalDGProductItem>());
 }
Exemple #7
0
 public void ShouldThrowPayPalDGExceptionWhenPassingNullItems()
 {
     PayPalDGModel.Create().WithProductItems(null);
 }
Exemple #8
0
            public void ShouldSetTheCallbackUrl()
            {
                var model = PayPalDGModel.Create().WithCancelCallbackUrl("http://localhost:1234/test");

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

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