public void ShouldSetTheCurrencyCodeTypeToPHP() { var model = PayPalDGModel.Create() .WithCurrencyCode(CurrencyCodeType.PHP); Assert.AreEqual(CurrencyCodeType.PHP, model.CurrencyCodeType); }
public void ShouldSetTheTaxTotalAmountTo15() { var model = PayPalDGModel.Create() .WithTaxTotalAmountOf(15); Assert.AreEqual(15, model.TaxTotalAmount); }
public void ShouldBeAbleToSetToFalse() { var model = PayPalDGModel.Create() .IncludeSupportForCreditCardPayment(false); Assert.IsFalse(model.SupportCreditCardPayment); }
public void WithOneParameter() { var model = PayPalDGModel.Create() .WithAdditionalCallbackParams(new List <PayPalDGAdditionalCallbackParam> { new PayPalDGAdditionalCallbackParam { Name = "p1", Value = "v1" } }); Assert.AreEqual("?p1=v1", model.BuildAdditionalCallbackParams()); }
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()); }
public void ShouldThrowPayPalDGExceptionWhenPassing0Item() { PayPalDGModel.Create().WithProductItems(new List <PayPalDGProductItem>()); }
public void ShouldThrowPayPalDGExceptionWhenPassingNullItems() { PayPalDGModel.Create().WithProductItems(null); }
public void ShouldSetTheCallbackUrl() { var model = PayPalDGModel.Create().WithCancelCallbackUrl("http://localhost:1234/test"); Assert.AreEqual("http://localhost:1234/test", model.CancelCallbackUrl); }
public void ShouldThrowPayPalDGExceptionWhenPassingInvalidUrl() { PayPalDGModel.Create().WithCancelCallbackUrl("/test/url"); }
public void ShouldSetTheSupportForCreditCardPaymentToTrue() { var model = PayPalDGModel.Create(); Assert.IsTrue(model.SupportCreditCardPayment); }
public void ShouldThrowPayPalDGExceptionWhenNoCallbackUrlSpecified() { PayPalDGModel.Create().WithCancelCallbackUrl(null); }
public void ShouldThrowPayPalDGExceptionWhenPassingInvalidUrl() { PayPalDGModel.Create().WithDoExpressCheckoutCallbackUrl("/test/url"); }
public void ShouldThrowPayPalDGExceptionWhenNoCallbackUrlSpecified() { PayPalDGModel.Create().WithDoExpressCheckoutCallbackUrl(null); }