diff options
author | abcd <qt-info@nokia.com> | 2011-07-27 12:16:00 +1000 |
---|---|---|
committer | abcd <qt_abcd1@ovi.com> | 2011-08-08 05:04:05 +0200 |
commit | 181ccbb58944d184c722800486ca452f00d0150e (patch) | |
tree | 49f0158507063a797570f8ef946fd4e1fbdeee8c /tests | |
parent | 8fcfa831b49d1d0514620a0f8c5c90a3c7428f1d (diff) | |
download | qtlocation-181ccbb58944d184c722800486ca452f00d0150e.tar.gz |
Add in data fields for primary contact details
Add in fields for the primary phone, fax, etc
details to QGeoPlace
At some later point in time if we add support
for multiple details of a single type, eg multiple
phone numbers, then the primary phone number would
be the first in the list.
Change-Id: I3cc46ffff201af73b08c4ed33ae1733076353bac
Reviewed-on: http://codereview.qt.nokia.com/2234
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgeoplace/tst_qgeoplace.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/qgeoplace/tst_qgeoplace.cpp b/tests/auto/qgeoplace/tst_qgeoplace.cpp index b39f3056..d146511e 100644 --- a/tests/auto/qgeoplace/tst_qgeoplace.cpp +++ b/tests/auto/qgeoplace/tst_qgeoplace.cpp @@ -31,6 +31,10 @@ private Q_SLOTS: void reviewCountTest(); void shortDescriptionTest(); void tagsTest(); + void primaryPhoneTest(); + void primaryFaxTest(); + void primaryEmailTest(); + void primaryUrlTest(); void operatorsTest(); }; @@ -254,6 +258,55 @@ void tst_QGeoPlace::tagsTest() QVERIFY2(testObj.tags()[1] == "2", "Wrong [1] value returned"); } +void tst_QGeoPlace::primaryPhoneTest() +{ + QGeoPlace place; + QVERIFY2(place.primaryPhone().isEmpty(), "Wrong default value"); + + place.setPrimaryPhone("555-5555"); + QCOMPARE(place.primaryPhone(), QString("555-5555")); + + place.setPrimaryPhone(QString()); + QCOMPARE(place.primaryPhone(), QString()); +} + +void tst_QGeoPlace::primaryFaxTest() +{ + QGeoPlace place; + QVERIFY2(place.primaryFax().isEmpty(), "Wrong default value"); + + place.setPrimaryFax("555-5555"); + QCOMPARE(place.primaryFax(), QString("555-5555")); + + place.setPrimaryFax(QString()); + QCOMPARE(place.primaryFax(), QString()); +} + +void tst_QGeoPlace::primaryEmailTest() +{ + QGeoPlace place; + QVERIFY2(place.primaryEmail().isEmpty(), "Wrong default value"); + + place.setPrimaryEmail("test@test.com"); + QCOMPARE(place.primaryEmail(), QString("test@test.com")); + + + place.setPrimaryEmail(QString()); + QCOMPARE(place.primaryEmail(), QString()); +} + +void tst_QGeoPlace::primaryUrlTest() +{ + QGeoPlace place; + QVERIFY2(place.primaryUrl().isEmpty(), "Wron default value"); + + place.setPrimaryUrl(QUrl("www.winterfell.com")); + QCOMPARE(place.primaryUrl(), QUrl("www.winterfell.com")); + + place.setPrimaryUrl(QUrl()); + QCOMPARE(place.primaryUrl(), QUrl()); +} + void tst_QGeoPlace::operatorsTest() { QGeoPlace testObj; |