Ejemplo n.º 1
0
        public void Initialize_Amount()
        {
            var money          = new Money(123);
            var withdrawnMoney = new WithdrawnMoney(money);

            var actual = withdrawnMoney.Amount;

            Assert.AreEqual(money, actual);
        }
Ejemplo n.º 2
0
        private DateTimeOffset[] GetOccurredOns()
        {
            var accountCreatedWithBalance      = new AccountCreatedWithBalance(Balance.Create(123m));
            var accountCreatedWithEmptyBalance = new AccountCreatedWithEmptyBalance();
            var depositedMoney = new DepositedMoney(new Money(123m));
            var withdrawnMoney = new WithdrawnMoney(new Money(123m));

            return(new[] { accountCreatedWithBalance.OccurredOn, accountCreatedWithEmptyBalance.OccurredOn, depositedMoney.OccurredOn, withdrawnMoney.OccurredOn });
        }
Ejemplo n.º 3
0
 private void When(WithdrawnMoney moneyWithdrawn)
 {
     this.balance = this.balance.Subtract(moneyWithdrawn.Amount);
 }
Ejemplo n.º 4
0
 private void When(WithdrawnMoney withdrawnMoney)
 {
     Balance = Balance.Withdraw(withdrawnMoney.Amount);
 }