Commit 611b5a49 authored by Martin Straka's avatar Martin Straka Committed by Karel Slaný
Browse files

Added DataBoxCreditInfo simple xml test.

parent d6a08431
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<p:DataBoxCreditInfoResponse xmlns:p="http://isds.czechpoint.cz/v20" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<p:currentCredit>98500</p:currentCredit>
<p:notifEmail xsi:nil="true" />
<p:ciRecords />
<p:dbStatus>
<p:dbStatusCode>0000</p:dbStatusCode>
<p:dbStatusMessage>Provedeno úspěšně.</p:dbStatusMessage>
</p:dbStatus>
</p:DataBoxCreditInfoResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
......@@ -68,6 +68,8 @@ private slots:
void pdzsiXmlTest(void);
void dciXmlTest(void);
private:
const QString m_oiContentPath;
const QString m_uiContentPath;
......@@ -75,6 +77,7 @@ private:
const QString m_dtiContentPath;
const QString m_pdziContentPath;
const QString m_pdzsiContentPath;
const QString m_dciContentPath;
};
TestIsdsXmlBox::TestIsdsXmlBox(void)
......@@ -84,7 +87,8 @@ TestIsdsXmlBox::TestIsdsXmlBox(void)
m_piContentPath("data/soap_GetPasswordInfoResponse.xml"),
m_dtiContentPath("data/soap_DTInfoResponse.xml"),
m_pdziContentPath("data/soap_PDZInfoResponse.xml"),
m_pdzsiContentPath("data/soap_PDZSendInfoResponse.xml")
m_pdzsiContentPath("data/soap_PDZSendInfoResponse.xml"),
m_dciContentPath("data/soap_DataBoxCreditInfoResponse.xml")
{
}
......@@ -281,6 +285,32 @@ void TestIsdsXmlBox::pdzsiXmlTest(void)
QVERIFY(!canPdz);
}
void TestIsdsXmlBox::dciXmlTest(void)
{
QByteArray data = readFileData(m_dciContentPath);
QVERIFY(data.size() > 0);
bool iOk = false;
qint64 currentCredit = 0;
QString notifEmail;
QList<Isds::CreditEvent> evnets =
Isds::Xml::toDataBoxCreditInfo(data, currentCredit,
notifEmail, &iOk);
QVERIFY(iOk);
QVERIFY(notifEmail.isEmpty());
QVERIFY(currentCredit == 98500);
QVERIFY(evnets.isEmpty());
data = QByteArray();
evnets = Isds::Xml::toDataBoxCreditInfo(data, currentCredit,
notifEmail, &iOk);
QVERIFY(!iOk);
QVERIFY(notifEmail.isEmpty());
QVERIFY(currentCredit == 98500);
QVERIFY(evnets.isEmpty());
}
QObject *newTestIsdsXmlBox(void)
{
return new (::std::nothrow) TestIsdsXmlBox();
......
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