Пример #1
0
        public void TestBank()
        {
            Console.WriteLine("*****Test Account Service*****");
            Console.WriteLine("Create service!");
            BankAccount        jo        = new BankAccount(1, "Jo", "Pinkman", 100m, Status.Gold);
            BinaryStorage      storage   = new BinaryStorage();
            BallExchenger      exchenger = new BallExchenger();
            BankAccountService service   = new BankAccountService(jo, storage, exchenger);

            Console.WriteLine("Add more money!");
            Console.WriteLine($"{jo.Cash} - money have Jo!");
            Console.WriteLine($"{jo.BonusBalls} - bonus balls have Jo!");
            service.PutMoneyIntoTheAccount(1000m);
            Console.WriteLine($"{jo.Cash} - money have Jo now!");
            Console.WriteLine($"{jo.BonusBalls} - bonus balls have Jo now!");
            Console.WriteLine("Withdraw money!");
            service.WithdrawFromTheAccount(500m);
            Console.WriteLine($"{jo.Cash} - money have Jo now!");
            Console.WriteLine($"{jo.BonusBalls} - bonus balls have Jo now!");
            Console.WriteLine("Withdraw more money!");
            service.WithdrawFromTheAccount(1000m);
            Console.WriteLine($"{jo.Cash} - money have Jo now!");
            Console.WriteLine($"{jo.BonusBalls} - bonus balls have Jo now!");
            Console.WriteLine($"Lets try to freeze Jo!");
            service.FreezeTheAccount();
            Console.WriteLine("*****End of test Bank's Service*****");
        }