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

            _paymentController.CheckoutAsync(payment);

            A.CallTo(() => _paymentStrategy.Pay(A <OrderDto> ._)).MustHaveHappenedOnceExactly();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 public double Pay(IPaymentStrategy strategy)
 {
     AmountPaid = strategy.Pay(GetPrice());
     return(AmountPaid);
 }
 public void Pay(double amount)
 {
     PaymentStrategy.Pay(amount);
 }
Ejemplo n.º 7
0
        public void MakePayment(IPaymentStrategy paymentStrategy)
        {
            var totalPrice = GetTotalPrice();

            paymentStrategy.Pay(totalPrice);
        }
Ejemplo n.º 8
0
        public void Pay(IPaymentStrategy paymentMethod)
        {
            double amount = CalculateTotal();

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

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