Beispiel #1
0
            public void AffectsBalance()
            {
                //Arrange
                decimal amount  = 20;
                decimal amount2 = 70;
                var     account = new Account.Domain.Models.Account("10");

                //Act
                account.Withdraw(amount);
                account.Withdraw(amount2);

                //Assert
                Assert.AreEqual(-amount - amount2, account.Balance);
            }
Beispiel #2
0
            public void AddsTransaction()
            {
                //Arrange
                decimal amount  = 50;
                var     account = new Account.Domain.Models.Account("10");

                //Act
                account.Withdraw(amount);

                //Assert
                var transaction = account.Transactions.OfType <WithdrawTransaction>().First();

                Assert.IsNotNull(transaction);
                Assert.AreEqual(-amount, transaction.Amount);
            }