Beispiel #1
0
        public void TestGetTotal()
        {
            AccountItemManagement aim = new AccountItemManagement();

            aim.addNewAccountItem(new AccountItem(0, 100, "test", new DateTime(10, 10, 10)));
            aim.addNewAccountItem(new AccountItem(0, 200, "test2222", new DateTime(10, 10, 10)));
            aim.addNewAccountItem(new AccountItem(0, 222, "test2222", new DateTime(10, 10, 10)));

            Assert.AreEqual(aim.getMoneyTotal(), 522);
        }
Beispiel #2
0
        public void TestDeleteAccountItem()
        {
            AccountItemManagement aim = new AccountItemManagement();

            aim.addNewAccountItem(new AccountItem(0, 100, "test", new DateTime(10, 10, 10)));
            aim.addNewAccountItem(new AccountItem(0, 200, "test2222", new DateTime(10, 10, 10)));
            aim.deleteAccountItem(0);

            List <AccountItem> t = new List <AccountItem>
            {
                new AccountItem(0, 200, "test2222", new DateTime(10, 10, 10))
            };

            Assert.AreEqual(t.Count, aim.Count());
            for (int i = 0; i < t.Count; i++)
            {
                Assert.AreEqual(t[i].Cost, aim.getItem(i).Cost);
                Assert.AreEqual(t[i].ItemName, aim.getItem(i).ItemName);
                Assert.AreEqual(t[i].Date, aim.getItem(i).Date);
            }
        }