Esempio n. 1
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());
        }
Esempio n. 2
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());
        }
Esempio 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);
        }
Esempio n. 4
0
        public void InitializedAccountHasZeroBalance()
        {
            Account account = new Account();

            Assert.Equal(0.0, account.Balance);
        }
Esempio n. 5
0
        public void InitializedAccountHasEmptyName()
        {
            Account account = new Account();

            Assert.Equal(string.Empty, account.Name);
        }
Esempio n. 6
0
        public void InitializedAccountCalculatedBalanceZero()
        {
            Account account = new Account();

            Assert.Equal(0.0, account.CalculateBalance());
        }
Esempio n. 7
0
        public void InitializedAcocuntHasZeroTransactions()
        {
            Account account = new Account();

            Assert.Equal(0, account.Transactions.Count);
        }