You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
725 B
37 lines
725 B
12 years ago
|
#include "xlsxdocument.h"
|
||
|
#include <QString>
|
||
|
#include <QtTest>
|
||
|
|
||
|
class ReadDocumentTest : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
ReadDocumentTest();
|
||
|
|
||
|
private Q_SLOTS:
|
||
|
void testDocProps();
|
||
|
};
|
||
|
|
||
|
ReadDocumentTest::ReadDocumentTest()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void ReadDocumentTest::testDocProps()
|
||
|
{
|
||
|
QXlsx::Document doc1;
|
||
|
doc1.setDocumentProperty("creator", "Debao");
|
||
|
doc1.setDocumentProperty("company", "Test");
|
||
|
doc1.saveAs("test.xlsx");
|
||
|
|
||
|
QXlsx::Document doc2("test.xlsx");
|
||
|
QCOMPARE(doc2.documentProperty("creator"), QString("Debao"));
|
||
|
QCOMPARE(doc2.documentProperty("company"), QString("Test"));
|
||
|
|
||
|
QFile::remove("test.xlsx");
|
||
|
}
|
||
|
|
||
|
QTEST_APPLESS_MAIN(ReadDocumentTest)
|
||
|
|
||
|
#include "tst_readdocumenttest.moc"
|