mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
start testing writing styles
This commit is contained in:
parent
8e17339ef0
commit
959d246995
27
source/workbook/tests/test_style_reader.hpp
Normal file
27
source/workbook/tests/test_style_reader.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <cxxtest/TestSuite.h>
|
||||||
|
|
||||||
|
#include <detail/style_serializer.hpp>
|
||||||
|
#include <detail/stylesheet.hpp>
|
||||||
|
#include <detail/workbook_impl.hpp>
|
||||||
|
#include <helpers/path_helper.hpp>
|
||||||
|
|
||||||
|
class test_style_reader : public CxxTest::TestSuite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void test_complex_formatting()
|
||||||
|
{
|
||||||
|
xlnt::workbook wb;
|
||||||
|
wb.load(PathHelper::GetDataDirectory("/reader/formatting.xlsx"));
|
||||||
|
|
||||||
|
// border_style
|
||||||
|
TS_ASSERT_EQUALS(wb.get_active_sheet().get_cell("E30").get_border().get_top()->get_color(), xlnt::color(xlnt::color::type::indexed, 10));
|
||||||
|
TS_ASSERT_EQUALS(wb.get_active_sheet().get_cell("E30").get_border().get_top()->get_border_style(), xlnt::border_style::thin);
|
||||||
|
|
||||||
|
// underline_style
|
||||||
|
TS_ASSERT_EQUALS(wb.get_active_sheet().get_cell("E30").get_font().get_underline(), xlnt::font::underline_style::none);
|
||||||
|
TS_ASSERT_EQUALS(wb.get_active_sheet().get_cell("F30").get_font().get_underline(), xlnt::font::underline_style::single);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user