Unit tests re-factoring for new coordinates on-going...
[situare] / tests / user / testuser.cpp
index 3b19369..8954faf 100644 (file)
@@ -54,7 +54,7 @@ private slots:
 TestUser::TestUser()
 {
     const QString address = "Kuja 3 A, 90560 Oulu, Finland";
-    const QPointF coordinates(65.3, 25.5);
+    const GeoCoordinate coordinates(65.3, 25.5);
     const QString name = "Jukka Kukka";
     const QString note = "Testing";
     const QUrl imageUrl = QUrl("http://profile.ak.fbcdn.net/v225/874/99/q100000139211584_3252.jpg");
@@ -90,19 +90,20 @@ void TestUser::testAddress()
 
 void TestUser::testCoordinates()
 {
-    QPointF oldValue = user->coordinates();
+    GeoCoordinate oldValue = user->coordinates();
 
     qDebug() << oldValue;
 
-    QPointF newValue(64.3, 25.8);
+    GeoCoordinate newValue(64.3, 25.8);
 
     user->setCoordinates(newValue);
 
-    QPointF currentValue = user->coordinates();
+    GeoCoordinate currentValue = user->coordinates();
 
     qDebug() << currentValue;
 
-    QCOMPARE(currentValue, newValue);
+    QCOMPARE(currentValue.latitude(), newValue.latitude());
+    QCOMPARE(currentValue.longitude(), newValue.longitude());
 }
 
 void TestUser::testName()