コード例 #1
0
        static void Main(string[] args)
        {
            BankAccount bankAccount = new BankAccount(100, "Ivan");

            bankAccount.Notify += DisplayMessage;
            bankAccount.Add(20);
            bankAccount.Take(30);
        }
コード例 #2
0
ファイル: BankAccount.cs プロジェクト: astorlucas/UnitTesting
        public void TransferFundsTo(BankAccount otherAccount, double amount)
        {
            if (otherAccount is null)
            {
                throw new ArgumentNullException(nameof(otherAccount));
            }

            Withdraw(amount);
            otherAccount.Add(amount);
        }