diff options
| author | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
| commit | e53f04284618713b0a90b7a691425c380e829476 (patch) | |
| tree | 801fea138160f9af426d62bf94ad5bf97123ece9 /test/stylesheet/tc_num_fmt.rb | |
| download | caxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip | |
first commit
Diffstat (limited to 'test/stylesheet/tc_num_fmt.rb')
| -rw-r--r-- | test/stylesheet/tc_num_fmt.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/stylesheet/tc_num_fmt.rb b/test/stylesheet/tc_num_fmt.rb new file mode 100644 index 00000000..281773ce --- /dev/null +++ b/test/stylesheet/tc_num_fmt.rb @@ -0,0 +1,31 @@ +require 'test/unit' +require 'axlsx.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 |
