#pragma once #include #include #include #include #include #include #include class test_produce_xlsx : public CxxTest::TestSuite { public: bool workbook_matches_file(xlnt::workbook &wb, const xlnt::path &file) { std::vector buffer; wb.save(buffer); wb.save(xlnt::path("a.xlsx")); xlnt::zip_file wb_archive(buffer); xlnt::zip_file file_archive(file); return xml_helper::archives_match(wb_archive, file_archive); } void test_produce_minimal() { xlnt::workbook wb = xlnt::workbook::minimal(); TS_ASSERT(workbook_matches_file(wb, path_helper::get_data_directory("8_minimal.xlsx"))); } void test_produce_default_excel() { xlnt::workbook wb = xlnt::workbook::empty_excel(); TS_ASSERT(workbook_matches_file(wb, path_helper::get_data_directory("9_default-excel.xlsx"))); } void test_produce_default_libre_office() { xlnt::workbook wb = xlnt::workbook::empty_libre_office(); TS_ASSERT(workbook_matches_file(wb, path_helper::get_data_directory("10_default-libre-office.xlsx"))); } };