Example #1
0
 public void MakePayment(IPaymentStrategy strategy)
 {
     foreach (Product product in products)
     {
         strategy.Pay(product);
     }
 }
        public void CheckoutAsync_CallsPaymentStrategy_Always()
        {
            const string payment = "payment";

            _paymentController.CheckoutAsync(payment);

            A.CallTo(() => _paymentStrategy.Pay(A <OrderDto> ._)).MustHaveHappenedOnceExactly();
        }
Example #3
0
 public void MakePayment(IPaymentStrategy Wallet, IPaymentStrategy Paypal)
 {
     foreach (Product product in products)
     {
         if (!Wallet.Pay(product))
         {
             Paypal.Pay(product);
         }
         else
         {
             System.Console.WriteLine("Al het geld is op ! :(");
         }
     }
 }
 public void PayTShirt(TShirt shirt)
 {
     Console.OutputEncoding = System.Text.Encoding.UTF8;
     Console.WriteLine();
     foreach (var variation in this.variations)
     {
         variation.Cost(shirt);
         Console.ForegroundColor = ConsoleColor.Magenta;
         System.Globalization.CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
         Console.WriteLine($"TShirt cost after applying {variation.GetType().Name} is: {shirt.Price :C2}");
     }
     Console.OutputEncoding = System.Text.Encoding.UTF8;
     Console.WriteLine();
     Console.ForegroundColor = ConsoleColor.Cyan;
     System.Globalization.CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
     Console.WriteLine($"Total Price: {shirt.Price :C2}");
     paymentMethod.Pay(shirt.Price);
     Console.WriteLine();
     Console.ForegroundColor = ConsoleColor.White;
 }
Example #5
0
 public double Pay(IPaymentStrategy strategy)
 {
     AmountPaid = strategy.Pay(GetPrice());
     return(AmountPaid);
 }
 public void Pay(double amount)
 {
     PaymentStrategy.Pay(amount);
 }
Example #7
0
        public void MakePayment(IPaymentStrategy paymentStrategy)
        {
            var totalPrice = GetTotalPrice();

            paymentStrategy.Pay(totalPrice);
        }
Example #8
0
        public void Pay(IPaymentStrategy paymentMethod)
        {
            double amount = CalculateTotal();

            paymentMethod.Pay(amount);
        }
Example #9
0
 public void Betal()
 {
     paymentStrategy.Pay();
 }
Example #10
0
 public string executeStrategy()
 {
     return(_strategy.Pay());
 }
Example #11
0
        public void Pay(int shopping_baskset)
        {
            var cost = _payment.Pay(shopping_baskset);

            Console.WriteLine("Cost of the T-Shirt(s): " + cost);
        }
 public void Pay()
 {
     _strategy.Pay();
 }
Example #13
0
 public ActionResult Pay(OrderViewModel order, Func <string, object, ViewResult> viewResult)
 {
     return(_payments.Pay(order, viewResult));
 }
Example #14
0
 public void CheckOut(IPaymentStrategy paymentMethod)
 {
     Display();
     paymentMethod.Pay(_totalAmount);
     GoodsList.Clear();
 }