Ejemplo n.º 1
0
        public static void Main()
        {
            Banking b = new Banking(20000);
            // Subscribing to the Notification from Bank
            EventListener evt = new EventListener(b);

            b.Deposit(90000);
            Console.WriteLine($"Net Balance after deposit {b.ShowBalance()}");
            b.Withdrawal(108000);
            Console.WriteLine($"Net Balance afeter withdrawal {b.ShowBalance()}");

            Console.WriteLine("Hello World");
        }
Ejemplo n.º 2
0
        public void EventTestMethod()
        {
            CS_SourceProject.Banking bank   = new CS_SourceProject.Banking(20000);
            List <string>            events = new List <string>();

            bank.OverBalance += delegate(int amount)
            {
                events.Add("OverBalance");
            };

            bank.Deposit(100000);
            Assert.AreEqual("OverBalance", events[0]);
        }