cover alignment.cpp

This commit is contained in:
Thomas Fussell 2016-07-09 10:13:56 -04:00
parent 874ea7abeb
commit 60372fb145
2 changed files with 35 additions and 2 deletions

View File

@ -61,8 +61,8 @@ protected:
std::string to_hash_string() const override;
private:
horizontal_alignment horizontal_ = horizontal_alignment::none;
vertical_alignment vertical_ = vertical_alignment::none;
horizontal_alignment horizontal_ = horizontal_alignment::general;
vertical_alignment vertical_ = vertical_alignment::bottom;
int text_rotation_ = 0;
bool wrap_text_ = false;
bool shrink_to_fit_ = false;

View File

@ -0,0 +1,33 @@
#pragma once
#include <iostream>
#include <cxxtest/TestSuite.h>
#include <xlnt/xlnt.hpp>
class test_alignment : public CxxTest::TestSuite
{
public:
void test_all()
{
xlnt::alignment alignment;
TS_ASSERT(alignment.has_horizontal());
TS_ASSERT_EQUALS(alignment.get_horizontal(), xlnt::horizontal_alignment::general);
alignment.set_horizontal(xlnt::horizontal_alignment::none);
TS_ASSERT(!alignment.has_horizontal());
TS_ASSERT(alignment.has_vertical());
TS_ASSERT_EQUALS(alignment.get_vertical(), xlnt::vertical_alignment::bottom);
alignment.set_vertical(xlnt::vertical_alignment::none);
TS_ASSERT(!alignment.has_vertical());
TS_ASSERT(!alignment.get_shrink_to_fit());
alignment.set_shrink_to_fit(true);
TS_ASSERT(alignment.get_shrink_to_fit());
TS_ASSERT(!alignment.get_wrap_text());
alignment.set_wrap_text(true);
TS_ASSERT(alignment.get_wrap_text());
}
};