Example #1
0
        public void when_calculating_account_totals()
        {
            refresh();
            should("Report Totals From transactions",
                   () =>
                   {
                       account = new BankAccount();
                       BankTransaction transaction1 = new BankTransaction
                                                          {
                                                              Amount = 1.00m,
                                                              Title = "Gum"
                                                          };
                       BankTransaction transaction2 = new BankTransaction
                                                          {
                                                              Amount = 2.50m,
                                                              Title =
                                                                  "Candy Bar Purchase"
                                                          };
                       account.Transactions.AddRange(new[] { transaction1, transaction2 });

                   });
            refresh();
            should("throw account exception if total less Than 0.0",
                  () =>
                  {
                      var total = emptyaccount.Total;
                  }, typeof(AccountException));
        }
Example #2
0
 private void refresh()
 {
     emptyaccount = new BankAccount();
     account = new BankAccount();
     emptyaccount.Transactions.Add(new BankTransaction() { Amount = -0.50m, Title = "Account Fee" });
 }