xlnt/source/styles/tests/test_number_style.hpp
2016-06-18 09:32:09 +01:00

23 lines
539 B
C++

#pragma once
#include <iostream>
#include <cxxtest/TestSuite.h>
#include "pugixml.hpp"
#include <xlnt/xlnt.hpp>
class test_number_style : public CxxTest::TestSuite
{
public:
void test_simple_date()
{
auto date = xlnt::date(2016, 6, 18);
auto date_number = date.to_number(xlnt::calendar::windows_1900);
xlnt::number_format ns = xlnt::number_format::date_ddmmyyyy();
auto formatted = ns.format(date_number, xlnt::calendar::windows_1900);
TS_ASSERT_EQUALS(formatted, "18/06/16");
}
};