1 #include <QtCore/QCoreApplication>
2 #include <QtTest/QtTest>
3 #include <eveaccount.h>
5 #include <eveskilltraining.h>
8 class EveModelTest: public QObject
17 #define GONTH_ID 1525655037
19 void EveModelTest::testXml()
22 model.setApiKey("2A671E53172C4F8A878BB770BBABFBD3CFF31815927F4E5591EA6D5576456E50");
23 model.setUserId(4079475);
24 model.fetchAccounts();
25 QSignalSpy spy(&model,SIGNAL(accountsReady()));
27 QCOMPARE(spy.length(),1);
28 QCOMPARE(model.characters().length(),2);
30 foreach (e,model.characters()) {
31 qDebug() << e.name << ":" << e.characterId;
33 e = model.characters()[0];
34 qDebug() << "e assigned";
35 QSignalSpy imagespy(&e,SIGNAL(imageLoaded()));
36 qDebug() << "spy installed";
38 qDebug() << "fetchImage called";
41 qDebug() << e.characterIcon;
42 QVERIFY(imagespy.length() == 1);
43 qDebug() << "Test done";
46 void EveModelTest::testSkills()
49 model.setApiKey("2A671E53172C4F8A878BB770BBABFBD3CFF31815927F4E5591EA6D5576456E50");
50 model.setUserId(4079475);
51 model.fetchAccounts();
53 EveCharacter e = model.characters()[0];
54 EveSkillTraining skill;
55 skill.setCharacter(&e);
56 skill.setAccount(&model);
59 qDebug() << skill.startTime
62 << skill.startSkillpoints
63 << skill.destSkillpoints
67 void EveModelTest::testSkillTree()
70 QSignalSpy spy(&stree,SIGNAL(skillsLoaded()));
73 QCOMPARE(spy.count(),1);
74 QCOMPARE(stree.skillName(3442),QString("Drone Interfacing"));
76 QVERIFY(QFile::exists("/var/tmp/skillCache"));
77 QFile::remove("/var/tmp/skillCache");
80 QTEST_MAIN(EveModelTest)