xlnt/source/tests/IntegrationTestSuite.h

47 lines
1.0 KiB
C
Raw Normal View History

2014-05-08 01:49:47 +08:00
#pragma once
#include <iostream>
#include <cxxtest/TestSuite.h>
2014-05-10 03:54:06 +08:00
#include "../xlnt.h"
2014-05-08 01:49:47 +08:00
class IntegrationTestSuite : public CxxTest::TestSuite
{
public:
IntegrationTestSuite()
{
}
void test_1()
{
2014-05-09 03:32:12 +08:00
xlnt::workbook wb;
2014-05-08 01:49:47 +08:00
auto ws = wb.get_active();
auto ws1 = wb.create_sheet();
auto ws2 = wb.create_sheet(0);
ws.set_title("New Title");
auto ws3 = wb["New Title"];
auto ws4 = wb.get_sheet_by_name("New Title");
TS_ASSERT_EQUALS(ws, ws3);
TS_ASSERT_EQUALS(ws, ws4);
TS_ASSERT_EQUALS(ws3, ws4);
auto sheet_names = wb.get_sheet_names();
for(auto sheet : wb)
{
std::cout << sheet.get_title() << std::endl;
}
2014-05-09 03:32:12 +08:00
//auto cell_range = ws["A1:C2"];
2014-05-08 01:49:47 +08:00
2014-05-09 03:32:12 +08:00
/* auto c = ws["A4"];
ws["A4"] = 4;
2014-05-08 01:49:47 +08:00
auto d = ws.cell(4, 2);
2014-05-09 03:32:12 +08:00
c = "hello, world";
std::cout << c << std::endl;
d = 3.14;
std::cout << d << std::endl;
2014-05-08 01:49:47 +08:00
2014-05-09 03:32:12 +08:00
wb.save("balances.xlsx");*/
2014-05-08 01:49:47 +08:00
}
};