//! Fired when dictionary call finalTranslation(..) with translation ready
void translation();
+ //! Removes given dictionary
void removeDictionary(CommonDictInterface* dict);
+
// TODO addToBookmark(Translation*);
// TODO removeFromBookmark(Translation*);
void stopSearchingTest();
void searchTest();
void translationTest();
+ void quitTest();
};
BackboneTest::BackboneTest()
back->translation();
QVERIFY2(translatS.count() == 1, "Lost finall 'ready()' signal");
- QVERIFY2(back->result().size() == total*2, "Lost some of translations");
+ QVERIFY2(back->result().size() == total*2, "Lost some of the translations");
+}
+
+void BackboneTest::quitTest() {
+ QSignalSpy translatS(back, SIGNAL(closeOk()));
+ for(int i = 0; i < total; i++) {
+ CommonDictInterfaceMock *m = (CommonDictInterfaceMock*) dict[i];
+ m->stopped = 0;
+ back->addDictionary(dict[i]);
+ }
+
+ for(int i = 0; i < total; i++) {
+ CommonDictInterfaceMock *m = (CommonDictInterfaceMock*)dict[i];
+ QCOMPARE(m->stopped, 0);
+ }
+
+ back->quit();
+
+ for(int i = 0; i < total; i++) {
+ CommonDictInterfaceMock *m = (CommonDictInterfaceMock*)dict[i];
+ QCOMPARE(m->stopped, 1);
+ }
+ QVERIFY2(translatS.count() == 1, "Lost finall 'closeOk()' signal");
}