public void CanLoadFileAccounts() { FileAccountTestRepository repo = new FileAccountTestRepository(); List <Account> accounts = repo.ReadAccounts(); Assert.AreEqual(3, accounts.Count()); Account check = accounts[0]; Assert.AreEqual("11111", check.AccountNumber); Assert.AreEqual("Free Customer", check.Name); Assert.AreEqual(100, check.Balance); Assert.AreEqual(AccountType.Free, check.Type); }
public void CanUpdateAccount() { FileAccountTestRepository repo = new FileAccountTestRepository(); List <Account> accounts = repo.ReadAccounts(); Account editedAccount = accounts[2]; editedAccount.Balance = 1500M; repo.SaveAccount(editedAccount); Assert.AreEqual(3, accounts.Count()); Account check = accounts[2]; Assert.AreEqual("33333", check.AccountNumber); Assert.AreEqual("Premium Customer", check.Name); Assert.AreEqual(1500M, check.Balance); Assert.AreEqual(AccountType.Premium, check.Type); }