Commit 35014824 authored by Laurent Montel's avatar Laurent Montel 😁

Add unittest

parent 467e8cd9
......@@ -8,6 +8,6 @@ kde4_add_unit_test( serversievesettingstest ${sieveedit_serversievesettings_sou
target_link_libraries( serversievesettingstest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS})
set( sieveeditorutiltest_source sieveeditorutiltest.cpp)
set( sieveeditorutiltest_source sieveeditorutiltest.cpp ../sieveeditorutil.cpp ../sieveserversettings.cpp)
kde4_add_unit_test( sieveeditorutiltest ${sieveeditorutiltest_source})
target_link_libraries( sieveeditorutiltest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS})
......@@ -18,6 +18,7 @@
*/
#include "sieveeditorutiltest.h"
#include "../sieveeditorutil.h"
#include <qtest_kde.h>
SieveEditorUtilTest::SieveEditorUtilTest(QObject *parent)
......@@ -31,4 +32,14 @@ SieveEditorUtilTest::~SieveEditorUtilTest()
}
void SieveEditorUtilTest::shouldHaveDefaultValue()
{
SieveEditorUtil::SieveServerConfig config;
QVERIFY(config.userName.isEmpty());
QVERIFY(config.password.isEmpty());
QVERIFY(config.serverName.isEmpty());
QCOMPARE(config.authenticationType, MailTransport::Transport::EnumAuthenticationType::PLAIN);
QCOMPARE(config.port, -1);
}
QTEST_KDEMAIN(SieveEditorUtilTest, NoGUI)
......@@ -29,6 +29,8 @@ class SieveEditorUtilTest : public QObject
public:
explicit SieveEditorUtilTest(QObject *parent = 0);
~SieveEditorUtilTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // SIEVEEDITORUTILTEST_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment