diff options
author | Alexis Menard <alexis.menard@openbossa.org> | 2011-08-11 12:31:41 -0300 |
---|---|---|
committer | Alexis Menard <alexis.menard@openbossa.org> | 2011-08-11 18:02:04 -0300 |
commit | b8cf8138e8284007517f3f4a613c98f882c60c80 (patch) | |
tree | d8575423a58b5f92e072e19942ca3b6507c6ef65 /tests | |
parent | e796525148498646bb61ca1592d5aa21d52405c9 (diff) | |
download | snowshoe-b8cf8138e8284007517f3f4a613c98f882c60c80.tar.gz |
Make the API of BookmarkModel a bit more usable from the outside
This patch also add an API to ease the usage(contains). It fixes also
a bug that you could add the same url multiple times.
Reviewed-by: Ademar Reis
Diffstat (limited to 'tests')
-rw-r--r-- | tests/database/tst_database.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/database/tst_database.cpp b/tests/database/tst_database.cpp index 932c4a8..995bb37 100644 --- a/tests/database/tst_database.cpp +++ b/tests/database/tst_database.cpp @@ -41,6 +41,7 @@ public slots: private slots: void initialization(); void insert(); + void remove(); void update(); private: @@ -99,11 +100,22 @@ void tst_DataBase::insert() const QString url = record.value("url").toString(); QCOMPARE(url, QLatin1String("http://www.nokia.com")); + QVERIFY(bookmarkModel->contains("http://www.nokia.com")); + const int date = record.value("dateAdded").toInt(); QVERIFY(date != 0); } } +void tst_DataBase::remove() +{ + BookmarkModel* bookmarkModel = DatabaseManager::instance()->bookmarkDataBaseModel(); + + bookmarkModel->remove("http://www.nokia.com"); + QVERIFY(!bookmarkModel->contains("http://www.nokia.com")); +} + + void tst_DataBase::update() { BookmarkModel* bookmarkModel = DatabaseManager::instance()->bookmarkDataBaseModel(); |