本文整理汇总了C++中MyMoneySplit::tagIdList方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMoneySplit::tagIdList方法的具体用法?C++ MyMoneySplit::tagIdList怎么用?C++ MyMoneySplit::tagIdList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMoneySplit
的用法示例。
在下文中一共展示了MyMoneySplit::tagIdList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testReadXML
void MyMoneySplitTest::testReadXML()
{
MyMoneySplit s;
QString ref_ok = QString(
"<!DOCTYPE TEST>\n"
"<SPLIT-CONTAINER>\n"
" <SPLIT payee=\"P000001\" reconciledate=\"\" shares=\"96379/100\" action=\"Deposit\" bankid=\"SPID\" number=\"124\" reconcileflag=\"2\" memo=\"MyMemo\" value=\"96379/1000\" account=\"A000076\">\n"
" <TAG id=\"G000001\"/>\n"
" </SPLIT>\n"
"</SPLIT-CONTAINER>\n");
QString ref_false = QString(
"<!DOCTYPE TEST>\n"
"<SPLIT-CONTAINER>\n"
" <SPLITS payee=\"P000001\" reconciledate=\"\" shares=\"96379/100\" action=\"Deposit\" bankid=\"SPID\" number=\"124\" reconcileflag=\"2\" memo=\"\" value=\"96379/1000\" account=\"A000076\" />\n"
" <TAG id=\"G000001\"/>\n"
"</SPLIT-CONTAINER>\n");
QDomDocument doc;
QDomElement node;
doc.setContent(ref_false);
node = doc.documentElement().firstChild().toElement();
try {
s = MyMoneySplit(node);
QFAIL("Missing expected exception");
} catch (const MyMoneyException &) {
}
doc.setContent(ref_ok);
node = doc.documentElement().firstChild().toElement();
try {
s = MyMoneySplit(node);
QVERIFY(s.id().isEmpty());
QVERIFY(s.payeeId() == "P000001");
QList<QString> tagIdList;
tagIdList << "G000001";
QVERIFY(s.tagIdList() == tagIdList);
QVERIFY(s.reconcileDate() == QDate());
QVERIFY(s.shares() == MyMoneyMoney(96379, 100));
QVERIFY(s.value() == MyMoneyMoney(96379, 1000));
QVERIFY(s.number() == "124");
QVERIFY(s.bankID() == "SPID");
QVERIFY(s.reconcileFlag() == MyMoneySplit::Reconciled);
QVERIFY(s.action() == MyMoneySplit::ActionDeposit);
QVERIFY(s.accountId() == "A000076");
QVERIFY(s.memo() == "MyMemo");
} catch (const MyMoneyException &) {
}
}