refaktoring
[mdictionary] / tests / GooglePluginTests / test.cpp
index c803afd..cca9ba3 100644 (file)
@@ -45,4 +45,32 @@ void GoogleTest::getDictionaryInfo() {
     QCOMPARE(plugin.infoNote(),QString(" [Polish-English] " ));
 }
 
+void GoogleTest::langFrom() {
+    GooglePlugin plugin;
+    Settings *settings=new Settings;
+    settings->setValue("lang_to","pl");
+    settings->setValue("lang_from","en");
+    plugin.setSettings(settings);
+    delete settings;
+
+    QCOMPARE(plugin.langFrom(),QString("English"));
+    QCOMPARE(plugin.langTo(),QString("Polish"));
+    QCOMPARE(plugin.type(),QString("google"));
+}
+
+void GoogleTest::getNew() {
+    GooglePlugin plugin;
+    Settings *settings=new Settings;
+    settings->setValue("lang_to","pl");
+    settings->setValue("lang_from","en");
+    CommonDictInterface *test=plugin.getNew(settings);
+    delete settings;
+
+    QCOMPARE(test->langFrom(),QString("English"));
+    QCOMPARE(test->langTo(),QString("Polish"));
+    QCOMPARE(test->type(),QString("google"));
+
+    delete test;
+}
+
 QTEST_MAIN(GoogleTest)