Example #1
0
        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);
        }
Example #2
0
        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");
        }
Example #3
0
        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();
        }