Sha256: de7307b4bb16ede23df2e96a2456020a26ea5e6f79e468f1840f1751ff106bef

Contents?: true

Size: 599 Bytes

Versions: 38

Compression:

Stored size: 599 Bytes

Contents

require 'tc_helper.rb'

class TestNumFmt < Test::Unit::TestCase

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

  def teardown
  end


  def test_initialiation
    assert_equal(@item.numFmtId, 0)
    assert_equal(@item.formatCode, "")
  end

  def test_numFmtId
    assert_raise(ArgumentError) { @item.numFmtId = -1.1 }
    assert_nothing_raised { @item.numFmtId = 2 }
    assert_equal(@item.numFmtId, 2)
  end

  def test_fomatCode
    assert_raise(ArgumentError) { @item.formatCode = -1.1 }
    assert_nothing_raised { @item.formatCode = "0" }
    assert_equal(@item.formatCode, "0")
  end

end

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
axlsx-1.3.5 test/stylesheet/tc_num_fmt.rb
axlsx-1.3.4 test/stylesheet/tc_num_fmt.rb
axlsx-1.3.3 test/stylesheet/tc_num_fmt.rb
axlsx-1.3.2 test/stylesheet/tc_num_fmt.rb
axlsx-1.3.1 test/stylesheet/tc_num_fmt.rb
axlsx-1.2.3 test/stylesheet/tc_num_fmt.rb
axlsx-1.2.2 test/stylesheet/tc_num_fmt.rb
axlsx-1.2.1 test/stylesheet/tc_num_fmt.rb
axlsx-1.2.0 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.8 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.7 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.6 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.5 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.4 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.3 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.2 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.1 test/stylesheet/tc_num_fmt.rb
axlsx-1.1.0 test/stylesheet/tc_num_fmt.rb