Initial commit
[profile/ivi/ofono-qt.git] / tests / test_ofononetworkoperator.cpp
1 #include <QtTest/QtTest>
2 #include <QtCore/QObject>
3
4 #include <ofononetworkoperator.h>
5
6 #include <QtDebug>
7
8
9 class TestOfonoNetworkOperator : public QObject
10 {
11     Q_OBJECT
12
13 private slots:
14
15     void statusChanged(QString status)
16     {
17         qDebug() << "statusChanged" << status;
18     }
19
20     void registerComplete(bool success)
21     {
22         qDebug() << "registerComplete:" << success;
23     }
24
25     void initTestCase()
26     {
27         m = new OfonoNetworkOperator("/phonesim/operator/23406", this);
28         connect(m, SIGNAL(registerComplete(bool)), this, 
29                 SLOT(registerComplete(bool)));
30         connect(m, SIGNAL(statusChanged(QString)), 
31                 this, 
32                 SLOT(statusChanged(QString)));
33     }
34
35     void testOfonoNetworkOperator()
36     {
37         qDebug() << "name():" << m->name();
38         qDebug() << "status():" << m->status();
39         qDebug() << "mobileCountryCode():" << m->mcc();
40         qDebug() << "mobileNetworkCode():" << m->mnc();
41         qDebug() << "technologies():" << m->technologies();
42         qDebug() << "additionalInfo():" << m->additionalInfo();
43         m->requestRegister();
44
45         QTest::qWait(120000);
46     }
47
48
49     void cleanupTestCase()
50     {
51
52     }
53
54
55 private:
56     OfonoNetworkOperator *m;
57 };
58
59 QTEST_MAIN(TestOfonoNetworkOperator)
60 #include "test_ofononetworkoperator.moc"