#ifndef TEST_CONFIGINFO_H
#define TEST_CONFIGINFO_H


#include <QtTest/QtTest>
#include <QMessageBox>

#include "../../config_info/headers/ConfigInfo.h"

class ConfigInfo_test : public QObject
{
   Q_OBJECT

public:
   explicit ConfigInfo_test();

   // Members
    private:
   QString m_eid;
   QString m_gid;
   QSqlDatabase& m_db;


private slots:
    void myFirstTest()
    { QVERIFY(1 == 1); }
    void mySecondTest()
    { QVERIFY(1 != 2); }
    void setBoldTest_data()
    {
       QTest::addColumn<QString>("string");
       QTest::addColumn<QString>("result");

       QTest::newRow("1.Item") << "hello" << "<b>hello</b>";
       QTest::newRow("2.Item") << "BOLD" << "<b>BOLD</b>";
       QTest::newRow("3.Item") << "  Picture is Bold  " << "<b>  Picture is Bold  </b>";
    }

    void setBoldTest()
    {
       ConfigInfo conf(m_db, m_eid, m_gid);

       QFETCH(QString, string);
       QFETCH(QString, result);
       qDebug() <<"       befor SetBold:" <<string <<":" <<result;
       QCOMPARE(conf.setBold(string), result);
       qDebug() <<"       after SetBold:" <<conf.setBold(string) <<":" <<result;
    }
};

//QTEST_APPLESS_MAIN(ConfigInfo_test);

#include "config_info_test.moc"

#endif // TEST_CONFIGINFO_H
