Commit 0cd7f344 authored by Laurent Montel's avatar Laurent Montel 😁

Rename class

parent 96f1cac3
......@@ -20,15 +20,15 @@
#include "grammalectegrammarerrortest.h"
#include "grammalectegrammarerror.h"
#include <QTest>
QTEST_MAIN(GrammalecteInfoTest)
QTEST_MAIN(GrammalecteGrammarErrorTest)
GrammalecteInfoTest::GrammalecteInfoTest(QObject *parent)
GrammalecteGrammarErrorTest::GrammalecteGrammarErrorTest(QObject *parent)
: QObject(parent)
{
}
void GrammalecteInfoTest::shouldHaveDefaultValue()
void GrammalecteGrammarErrorTest::shouldHaveDefaultValue()
{
GrammalecteGrammarError info;
QCOMPARE(info.end(), -1);
......@@ -39,3 +39,29 @@ void GrammalecteInfoTest::shouldHaveDefaultValue()
QVERIFY(!info.color().isValid());
QVERIFY(!info.isValid());
}
/*
void GrammalecteParserTest::shouldParseJson_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<int>("numberOfElement");
QTest::newRow("noerror") << QStringLiteral("noerror") << 0;
QTest::newRow("noerror2") << QStringLiteral("noerror2") << 0;
QTest::newRow("result2") << QStringLiteral("result2") << 3;
}
void GrammalecteParserTest::shouldParseJson()
{
QFETCH(QString, fileName);
QFETCH(int, numberOfElement);
const QString originalJsonFile = QLatin1String(GRAMMALECTE_DATA_DIR) + QLatin1Char('/') + fileName + QStringLiteral(".json");
QFile f(originalJsonFile);
QVERIFY(f.open(QIODevice::ReadOnly));
const QByteArray content = f.readAll();
f.close();
const QJsonDocument doc = QJsonDocument::fromJson(content);
const QJsonObject fields = doc.object();
GrammalecteParser parser;
QCOMPARE(parser.parseResult(fields).count(), numberOfElement);
}
*/
......@@ -21,12 +21,12 @@
#include <QObject>
class GrammalecteInfoTest : public QObject
class GrammalecteGrammarErrorTest : public QObject
{
Q_OBJECT
public:
explicit GrammalecteInfoTest(QObject *parent = nullptr);
~GrammalecteInfoTest() = default;
explicit GrammalecteGrammarErrorTest(QObject *parent = nullptr);
~GrammalecteGrammarErrorTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
......
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