Sha256: 082ed0512e61c42f0ac80652498a71f1a7b91988db442a91bd42ae58a782f681

Contents?: true

Size: 885 Bytes

Versions: 5

Compression:

Stored size: 885 Bytes

Contents

require 'tc_helper.rb'

class TestPatternFill < Test::Unit::TestCase

  def setup
    @item = Axlsx::PatternFill.new
  end

  def teardown
  end


  def test_initialiation
    assert_equal(@item.patternType, :none)
    assert_equal(@item.bgColor, nil)
    assert_equal(@item.fgColor, nil)
  end

  def test_bgColor
    assert_raise(ArgumentError) { @item.bgColor = -1.1 }
    assert_nothing_raised { @item.bgColor = Axlsx::Color.new }
    assert_equal(@item.bgColor.rgb, "FF000000")
  end

  def test_fgColor
    assert_raise(ArgumentError) { @item.fgColor = -1.1 }
    assert_nothing_raised { @item.fgColor = Axlsx::Color.new }
    assert_equal(@item.fgColor.rgb, "FF000000")
  end

  def test_pattern_type
    assert_raise(ArgumentError) { @item.patternType = -1.1 }
    assert_nothing_raised { @item.patternType = :lightUp }
    assert_equal(@item.patternType, :lightUp)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
axlsx-1.1.4 test/stylesheet/tc_pattern_fill.rb
axlsx-1.1.3 test/stylesheet/tc_pattern_fill.rb
axlsx-1.1.2 test/stylesheet/tc_pattern_fill.rb
axlsx-1.1.1 test/stylesheet/tc_pattern_fill.rb
axlsx-1.1.0 test/stylesheet/tc_pattern_fill.rb