Esempio n. 1
0
 public static Customer CreateValidCustomer()
 {
     return(new Customer("1234567890", "Rasmus Naver", new List <Account>()
     {
         CheckingAccountTestClass.CreateValidCheckingAccount(), SavingAccountTestClass.CreateValidSavingAccount()
     }));
 }
Esempio n. 2
0
        public void AccountCalculateCostOfMonthTest()
        {
            Account     account1             = SavingAccountTestClass.CreateValidSavingAccount();
            Account     account2             = SavingAccountTestClass.CreateValidSavingAccount();
            Transaction transaction          = new Transaction(2, DateTime.Now, account1, account2);
            decimal     transactionCost      = 1.95m;
            decimal     monthlyCost          = 15;
            decimal     numberOfTransactions = 21;
            decimal     costOfTransactions   = transactionCost * numberOfTransactions;
            Month       transactionMonth     = (Month)DateTime.Now.Month;

            for (int i = 0; i < numberOfTransactions; i++)
            {
                account1.PerformTransaction(transaction);
            }
            decimal costOfMonth = account1.CalculateCostOfMonth(transactionMonth, transactionCost, monthlyCost);

            Assert.AreEqual(monthlyCost + costOfTransactions, costOfMonth);
        }