Ejemplo n.º 1
0
        public void AccountWithInitialTransactionOfDepositeBalanceIsTransactionAmount()
        {
            double initialAmount = 15.0;
            Account account = new Account();
            account.Transactions.Add(
                new Transaction
                {
                    Amount = initialAmount,
                    TransactionType = Enumerations.TransactionTypes.Desposit
                });

            Assert.Equal(initialAmount, account.CalculateBalance());
        }
Ejemplo n.º 2
0
        public void AccountWithZeroBalanceWithWidthDrawalIsNegativeBalance()
        {
            double withdrawalAmount = 15;
            Account account = new Account();
            account.Transactions.Add(
                new Transaction
                {
                    Amount = withdrawalAmount,
                    TransactionType = Enumerations.TransactionTypes.Withdrawal
                });

            Assert.Equal(-withdrawalAmount, account.CalculateBalance());
        }
Ejemplo n.º 3
0
        public void AccountsBalanceIsCalculatedAmount()
        {
            double initialAmount = 15.0;
            Account account = new Account();
            account.Transactions.Add(
                new Transaction
                {
                    Amount = initialAmount,
                    TransactionType = Enumerations.TransactionTypes.Desposit
                });

            Assert.Equal(account.CalculateBalance(), account.Balance);
        }
Ejemplo n.º 4
0
        public void InitializedAccountCalculatedBalanceZero()
        {
            Account account = new Account();

            Assert.Equal(0.0, account.CalculateBalance());
        }