Commit ecfb98bc authored by Volker Krause's avatar Volker Krause
Browse files

Add unit test for schema templates

parent 83d2b704
......@@ -13,6 +13,7 @@ function(uf_add_test _file)
endfunction()
uf_add_test(producttest UserFeedbackAnalyzer)
uf_add_test(schematemplatetest.cpp UserFeedbackAnalyzer)
uf_add_test(productapitest UserFeedbackTestUtils)
uf_add_test(productmodeltest UserFeedbackTestUtils)
uf_add_test(schemamodeltest UserFeedbackTestUtils)
......
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <core/schemaentry.h>
#include <core/schemaentryelement.h>
#include <core/schemaentrytemplates.h>
#include <QDebug>
#include <QtTest/qtest.h>
#include <QObject>
#include <QStandardPaths>
using namespace UserFeedback::Analyzer;
class SchemaTemplateTest : public QObject
{
Q_OBJECT
private slots:
void initTestCase()
{
Q_INIT_RESOURCE(schemaentrytemplates);
QStandardPaths::setTestModeEnabled(true);
}
void testTemplateLoading()
{
QVERIFY(SchemaEntryTemplates::availableTemplates().size() > 5);
for (const auto &t : SchemaEntryTemplates::availableTemplates()) {
QVERIFY(!t.name().isEmpty());
QVERIFY(!t.elements().isEmpty());
}
}
};
QTEST_MAIN(SchemaTemplateTest)
#include "schematemplatetest.moc"
Supports Markdown
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