qtmeetings sources to Maemo garage
[qtmeetings] / tests / Domain / Configuration / ConnectionSettings / TestConnectionSettings.cpp
1 #include <QtTest/QtTest>
2 #include "ConnectionSettings.h"
3 #include "TestConnectionSettings.h"
4
5 static const QString URL = "http://this.is.just/a_test_url/for unit test";
6 static const QString USERNAME = "Username";
7 static const QString PASSWORD = "Password";
8 static const unsigned int INTERVAL = 60;
9
10 void TestConnectionSettings::initTestCase()
11 {
12         iConnection = new ConnectionSettings( QUrl( URL ), USERNAME, PASSWORD, INTERVAL );
13         QVERIFY( iConnection != 0 );
14 }
15
16 void TestConnectionSettings::cleanupTestCase()
17 {
18         delete iConnection;
19         iConnection = NULL;
20 }
21
22 void TestConnectionSettings::init()
23 {
24         //qDebug("Debug line");
25 }
26
27 void TestConnectionSettings::cleanup()
28 {
29         //nothing to do
30 }
31
32 void TestConnectionSettings::testServerUrl()
33 {
34         QCOMPARE( iConnection->serverUrl().toString(), URL );
35 }
36
37 void TestConnectionSettings::testUsername()
38 {
39         QCOMPARE( iConnection->username(), USERNAME );
40 }
41
42 void TestConnectionSettings::testPassword()
43 {
44         QCOMPARE( iConnection->password(), PASSWORD );
45 }
46
47 void TestConnectionSettings::testInterval()
48 {
49         QCOMPARE( iConnection->refreshInterval(), INTERVAL );
50 }