public void CanGetAListOfAccounts() { DataHelper.NewDb(); var service = new RentalsService(); Assert.AreEqual(DataHelper.Accounts.Count, service.GetAllAccounts().Count); }
public void CanGetAnEmptyListOfAccounts() { DataHelper.NewDb(false); var service = new RentalsService(); Assert.AreEqual(0, service.GetAllAccounts().Count); }
public void GetAllAccountsIncludesBalances() { DataHelper.NewDb(); var service = new RentalsService(); var actual = new List <Account>(service.GetAllAccounts()); Assert.AreEqual(DataHelper.Accounts.Count, actual.Count); Assert.AreEqual(DataHelper.GetAccountBalance(1), actual[0].Balance); Assert.AreEqual(DataHelper.GetAccountBalance(2), actual[1].Balance); Assert.AreEqual(DataHelper.GetAccountBalance(3), actual[2].Balance); }
public void CanInsertNewAccount() { DataHelper.NewDb(); var accountToAdd = new Account() { Name = "BankAccount4", OpeningBalance = 100.99m }; var service = new RentalsService(); service.SaveNewAccount(accountToAdd); Assert.AreEqual(DataHelper.Accounts.Count + 1, service.GetAllAccounts().Count); }