Sha256: e6397c55be0aff34ef71b5c2c2510524e5d99783a3db97020214555563aec9d6

Contents?: true

Size: 1.38 KB

Versions: 38

Compression:

Stored size: 1.38 KB

Contents

require 'tc_helper.rb'

class TestCellStyle < Test::Unit::TestCase

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

  def teardown
  end

  def test_initialiation
    assert_equal(@item.name, nil)
    assert_equal(@item.xfId, nil)
    assert_equal(@item.builtinId, nil)
    assert_equal(@item.iLevel, nil)
    assert_equal(@item.hidden, nil)
    assert_equal(@item.customBuiltin, nil)
  end

  def test_name
    assert_raise(ArgumentError) { @item.name = -1 }
    assert_nothing_raised { @item.name = "stylin" }
    assert_equal(@item.name, "stylin" )
  end

  def test_xfId
    assert_raise(ArgumentError) { @item.xfId = -1 }
    assert_nothing_raised { @item.xfId = 5 }
    assert_equal(@item.xfId, 5 )
  end

  def test_builtinId
    assert_raise(ArgumentError) { @item.builtinId = -1 }
    assert_nothing_raised { @item.builtinId = 5 }
    assert_equal(@item.builtinId, 5 )
  end

  def test_iLevel
    assert_raise(ArgumentError) { @item.iLevel = -1 }
    assert_nothing_raised { @item.iLevel = 5 }
    assert_equal(@item.iLevel, 5 )
  end

  def test_hidden
    assert_raise(ArgumentError) { @item.hidden = -1 }
    assert_nothing_raised { @item.hidden = true }
    assert_equal(@item.hidden, true )
  end

  def test_customBuiltin
    assert_raise(ArgumentError) { @item.customBuiltin = -1 }
    assert_nothing_raised { @item.customBuiltin = true }
    assert_equal(@item.customBuiltin, true )
  end

end

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
caxlsx-3.1.1 test/stylesheet/tc_cell_style.rb
caxlsx-3.1.0 test/stylesheet/tc_cell_style.rb
bonio-axlsx-2.2.3 test/stylesheet/tc_cell_style.rb
caxlsx-3.0.4 test/stylesheet/tc_cell_style.rb
caxlsx-3.0.3 test/stylesheet/tc_cell_style.rb
caxlsx-3.0.2 test/stylesheet/tc_cell_style.rb
caxlsx-2.0.2 test/stylesheet/tc_cell_style.rb
caxlsx-3.0.1 test/stylesheet/tc_cell_style.rb
caxlsx-3.0.0 test/stylesheet/tc_cell_style.rb
axlsx-alt-3.0.1 test/stylesheet/tc_cell_style.rb
axlsx-alt-3.0.0 test/stylesheet/tc_cell_style.rb
axlsx-3.0.0.pre test/stylesheet/tc_cell_style.rb
bonio-axlsx-2.2.2 test/stylesheet/tc_cell_style.rb
bonio-axlsx-2.2.1 test/stylesheet/tc_cell_style.rb
dg-axlsx-2.1.0 test/stylesheet/tc_cell_style.rb
axlsx-2.1.0.pre test/stylesheet/tc_cell_style.rb
l_axlsx-2.0.1 test/stylesheet/tc_cell_style.rb
axlsx-2.0.1 test/stylesheet/tc_cell_style.rb
axlsx-2.0.0 test/stylesheet/tc_cell_style.rb
axlsx-1.3.6 test/stylesheet/tc_cell_style.rb