Deposit() public method

public Deposit ( int amount ) : void
amount int
return void
        public void Transfer()
        {
            var twoAccounts = Context(delegate
            {
                var from = new Account("A");
                var to = new Account("B");
                from.Deposit(100);
                return new { from, to };
            });

            Given(twoAccounts)
            .When(c => c.from.Transfer(25, c.to))
            .Then(c => c.from.Balance == 75)
             .And(c => c.to.Balance == 25);
        }
Exemplo n.º 2
0
 public void Transfer(int amount, Account account)
 {
     Balance -= amount;
     account.Deposit(amount);
 }