Sha256: b33bf3bb3600e6ca1532a5444a20eb78113c3cddae339d270b679d23db82a55b

Contents?: true

Size: 909 Bytes

Versions: 18

Compression:

Stored size: 909 Bytes

Contents

require 'test/unit'
require 'axlsx.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

18 entries across 18 versions & 1 rubygems

Version Path
axlsx-1.0.18 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.17 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.16 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.15 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.14 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.12 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.11 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.10 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.10a test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.9 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.8 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.7 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.6 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.5 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.4 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.3 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.1 test/stylesheet/tc_pattern_fill.rb
axlsx-1.0.0 test/stylesheet/tc_pattern_fill.rb