Fix for RemoteDBMgr unit tests
[irwi] / ut / ut_remotelist / ut_remotelist.h
1 #ifndef _UT_REMOTELIST_H_
2 #define _UT_REMOTELIST_H_
3
4 #include <QObject>
5 #include <QStringList>
6 #include <QMap>
7 #include <QList>
8 #include <QDomElement>
9
10 #include "model.h"
11 #include "remotelist.h"
12
13 class Ut_RemoteList: public QObject
14 {
15     Q_OBJECT
16
17 private slots:
18     void initTestCase();
19     void cleanupTestCase();
20
21     void testIsValid();
22     void testIsValid_setContent();
23     void testLetters();
24     void testManufacturers();
25     void testModels();
26     void testLetters_setContent();
27     void testManufacturers_setContent();
28     void testModels_setContent();
29
30 private:
31     // Creates the xml document containing the test data
32     void createDocument();
33
34     // Creates element for each mfg which name starts with the given letter.
35     void createMfgElements(QChar &letter, QDomElement &parent);
36     void createModelElements(const QString &mfg, QDomElement &parent);
37
38     void compareLetters(RemoteList &subject);
39     void compareManufacturers(RemoteList &subject);
40     void compareModels(RemoteList &subject);
41
42 private:
43     QDomDocument document;
44     QMap<QString, QStringList> validMfgs;
45     QMap<QString, QList<Model> > validModels;
46 };
47
48 #endif // UT_REMOTELIST_H
49
50
51