public static void TestPaymentStrategy() { List <Card> Cards = new List <Card> { new Visa("1234 5678 9012 3456", new DateTime(2022, 10, 1), -1000), new MasterCard("2234 5678 9012 3477", new DateTime(2021, 1, 1), 5000), new MasterCard("3234 5678 9012 3000", new DateTime(2024, 12, 31), 500), new Visa("4234 5678 9012 3456", new DateTime(2022, 10, 1), 10000), }; PaymentProcessor processor = new PaymentProcessor(); processor.strategies = new Dictionary <string, IPayment>() { { "MASTER", new MasterCardPayment() }, { "VISA", new VisaPayment() }, }; Bill bill = new Bill(600); foreach (var card in Cards) { if (processor.Checkout(bill, card)) { Console.WriteLine($"Payd by {card.Number}"); } else { Console.WriteLine($"Not payd by {card.Number}"); } } }