public void TestUpdateAccount() { da = new CDataAccess(fileName); Assert.IsNotNull(da); da.ReadAllAccounts(); AddAccount(); Assert.That(da.Accounts.Count == 3); Assert.That(da.Accounts[0].AccountName == "CreditCard"); Assert.That(da.Accounts[1].AccountName == "Current"); Assert.That(da.Accounts[2].AccountName == "Savings"); Account ac = new Account(); ac.AccountName = "ISA"; da.UpdateAccount(da.Accounts[2], ac); da.ReadAllAccounts(); Assert.That(da.Accounts.Count == 3); Assert.That(da.Accounts[0].AccountName == "CreditCard"); Assert.That(da.Accounts[1].AccountName == "Current"); Assert.That(da.Accounts[2].AccountName == "ISA"); da.DeleteAccount(ac); }
public void TestReadAccounts() { da = new CDataAccess(fileName); Assert.IsNotNull(da); da.ReadAllAccounts(); Assert.That(da.Accounts.Count == 2); Assert.That(da.Accounts[0].AccountName == "CreditCard"); Assert.That(da.Accounts[1].AccountName == "Current"); }
public void TestAddAccount() { da = new CDataAccess(fileName); Assert.IsNotNull(da); da.ReadAllAccounts(); AddAccount(); Assert.That(da.Accounts.Count == 3); Assert.That(da.Accounts[0].AccountName == "CreditCard"); Assert.That(da.Accounts[1].AccountName == "Current"); Assert.That(da.Accounts[2].AccountName == "Savings"); DeleteAccount(); }