Excel-Writer-XLSX
view release on metacpan or search on metacpan
t/package/styles/sub_write_xf.t view on Meta::CPAN
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 30. Test the _write_xf() method. Alignment = rotation
#
%properties = ( rotation => 270 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="255"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 31. Test the _write_xf() method. Alignment = rotation
#
%properties = ( rotation => 90 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 32. Test the _write_xf() method. Alignment = rotation
#
%properties = ( rotation => -90 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="180"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 33. Test the _write_xf() method. With cell protection.
#
%properties = ( locked => 0 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection locked="0"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 34. Test the _write_xf() method. With cell protection.
#
%properties = ( hidden => 1 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection hidden="1"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 35. Test the _write_xf() method. With cell protection.
#
%properties = ( locked => 0, hidden => 1 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection locked="0" hidden="1"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
###############################################################################
#
# 36. Test the _write_xf() method. With cell protection + align.
#
%properties = ( align => 'right', locked => 0, hidden => 1 );
$caption = " \tStyles: _write_xf()";
$expected = '<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1" applyProtection="1"><alignment horizontal="right"/><protection locked="0" hidden="1"/></xf>';
$format = Excel::Writer::XLSX::Format->new( {}, {}, %properties );
$style = _new_style(\$got);
$style->_write_xf( $format );
is( $got, $expected, $caption );
__END__
( run in 0.941 second using v1.01-cache-2.11-cpan-39bf76dae61 )