public void CannotInsertNewAccountWithSameNameAsAnExistingAccount() { DataHelper.NewDb(); var accountToAdd = new Account() { Name = "BankAccount3", OpeningBalance = 100.99m }; var service = new RentalsService(); service.SaveNewAccount(accountToAdd); Assert.Fail("Added an account with same name as an exiting account"); }
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); }