Beispiel #1
0
        public static void Main(string[] args)
        {
            IPaymentStrategy <Cash> cashPayment = new CashPayment();

            cashPayment.Pay(new Cash());

            IPaymentStrategy <CreditCard> creditCardPayment = new CreditCardPayment();

            creditCardPayment.Pay(new CreditCard(CardType.Visa, "4539867398424592"));

            IPaymentStrategy <Paypal> payPalPayment = new PayPalPayment();

            payPalPayment.Pay(new Paypal("*****@*****.**"));
        }
Beispiel #2
0
        public void Pay_With_Paypal_Should_Not_Throw()
        {
            IPaymentStrategy <Paypal> payPalPayment = new PayPalPayment();

            Assert.DoesNotThrow(() => payPalPayment.Pay(new Paypal("*****@*****.**")));
        }