rewrite for eet 2.0 api version v4
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#include "eetv4client.h"
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
class EetV4ClientTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void rejectsNonHttpsEndpoint();
|
||||
void rejectsNonPositiveTimeout();
|
||||
};
|
||||
|
||||
void EetV4ClientTest::rejectsNonHttpsEndpoint()
|
||||
{
|
||||
EetV4Client client({QUrl(QStringLiteral("http://localhost/eet")), 1000});
|
||||
EetV4Response response;
|
||||
QString error;
|
||||
QVERIFY(!client.sendSale({}, QStringLiteral("missing.p12"), {}, &response, &error));
|
||||
QCOMPARE(error, QStringLiteral("EET endpoint must be a valid HTTPS URL."));
|
||||
}
|
||||
|
||||
void EetV4ClientTest::rejectsNonPositiveTimeout()
|
||||
{
|
||||
EetV4Client client({QUrl(QStringLiteral("https://localhost/eet")), 0});
|
||||
EetV4Response response;
|
||||
QString error;
|
||||
QVERIFY(!client.sendSale({}, QStringLiteral("missing.p12"), {}, &response, &error));
|
||||
QCOMPARE(error, QStringLiteral("EET timeout must be positive."));
|
||||
}
|
||||
|
||||
QTEST_MAIN(EetV4ClientTest)
|
||||
#include "eetv4client_test.moc"
|
||||
Reference in New Issue
Block a user