Add EntryModel.

This commit is contained in:
Felix Geyer 2010-08-18 16:22:48 +02:00
parent 84bc5ef463
commit 8d623f37ca
11 changed files with 341 additions and 9 deletions

View file

@ -27,6 +27,7 @@ class TestGroup : public QObject
private Q_SLOTS:
void testParenting();
void testSignals();
void testEntries();
};
void TestGroup::testParenting()
@ -100,6 +101,25 @@ void TestGroup::testSignals()
QCOMPARE(spyAdded.count(), 1);
QCOMPARE(spyAboutToRemove.count(), 1);
QCOMPARE(spyRemoved.count(), 1);
delete db;
}
void TestGroup::testEntries()
{
Group* group = new Group();
Entry* entry1 = new Entry();
entry1->setGroup(group);
Entry* entry2 = new Entry();
entry2->setGroup(group);
QCOMPARE(group->entries().size(), 2);
QVERIFY(group->entries().at(0) == entry1);
QVERIFY(group->entries().at(1) == entry2);
delete group;
}
QTEST_MAIN(TestGroup);