Esempio n. 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();
        }
Esempio 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;
 }
Esempio n. 5
0
 public double Pay(IPaymentStrategy strategy)
 {
     AmountPaid = strategy.Pay(GetPrice());
     return(AmountPaid);
 }
 public void Pay(double amount)
 {
     PaymentStrategy.Pay(amount);
 }
Esempio n. 7
0
        public void MakePayment(IPaymentStrategy paymentStrategy)
        {
            var totalPrice = GetTotalPrice();

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

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

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