Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var debitCalculator = new DebitAccountWithdrawalFeeCalculator();
            WithdrawlAndDepositAccount debitAccount = new DebitAccount();

            Atm.DepositMoneyTo(debitAccount, 100);
            Atm.WithdrawMoneyFrom(debitAccount, 50, debitCalculator);

            var creditCalculator = new CreditAccountWithdrawalFeeCalculator();
            WithdrawlAndDepositAccount creditAccount = new CreditAccount();

            Atm.DepositMoneyTo(creditAccount, 100);
            Atm.WithdrawMoneyFrom(creditAccount, 150, new DummyCalculator());

            TestWithdrawal(new DebitAccount());
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            IAutomaticTellerMachine atm = new AutomaticTellerMachine();
            var debitCalculator         = new DebitAccountWithdrawalFeeCalculator();
            IWithdrawalAndDepositAccount debitAccount = new DebitAccount();

            atm.DepositMoneyTo(debitAccount, 100);
            atm.WithdrawMoneyFrom(debitAccount, 50, debitCalculator);

            var creditCalculator = new CreditAccountWithdrawalFeeCalculator();
            IWithdrawalAndDepositAccount creditAccount = new CreditAccount();

            atm.DepositMoneyTo(creditAccount, 100);
            atm.WithdrawMoneyFrom(creditAccount, 150, new DummyCalculator());

            TestWithdrawalFromDebitAccount();
        }