Sha256: 9f867bdadda16750c410367e6c54f0d9132bd507f6b3da02a313e9cae0bda03b

Contents?: true

Size: 1.05 KB

Versions: 36

Compression:

Stored size: 1.05 KB

Contents

require 'test/unit'
require 'testcase'
require 'fox16'

include Fox

class TC_FXListBox < TestCase
  def setup
    super(self.class.name)
    @listBox = FXListBox.new(mainWindow)
  end
  
  def test_appendItem
    assert_equal(0, @listBox.numItems)
    @listBox.appendItem("An item")
    assert_equal(1, @listBox.numItems)
  end

  def test_appendOp
    assert_equal(0, @listBox.numItems)
    @listBox << "An item"
    assert_equal(1, @listBox.numItems)
  end

  def test_moveItem
    @listBox.appendItem("First")
    @listBox.appendItem("Second")
    assert_raises(IndexError) {
      @listBox.moveItem(0, -1)
    }
    assert_raises(IndexError) {
      @listBox.moveItem(0, 2)
    }
    assert_raises(IndexError) {
      @listBox.moveItem(-1, 0)
    }
    assert_raises(IndexError) {
      @listBox.moveItem(2, 0)
    }
    assert_nothing_raised {
      @listBox.moveItem(0, 0)
      @listBox.moveItem(0, 1)
      @listBox.moveItem(1, 0)
      @listBox.moveItem(1, 1)
    }
    assert_equal(0, @listBox.moveItem(0, 1))
    assert_equal(1, @listBox.moveItem(1, 0))
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
fxruby-1.6.20-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.20-x86-linux test/TC_FXListBox.rb
fxruby-1.6.20 test/TC_FXListBox.rb
fxruby-1.6.20-universal-darwin-10 test/TC_FXListBox.rb
fxruby-1.6.19-x86-mingw32 tests/TC_FXListBox.rb
fxruby-1.6.14-mswin32 tests/TC_FXListBox.rb
fxruby-1.6.13-mswin32 tests/TC_FXListBox.rb
fxruby-1.6.10 tests/TC_FXListBox.rb
fxruby-1.6.11 tests/TC_FXListBox.rb
fxruby-1.6.12 tests/TC_FXListBox.rb
fxruby-1.6.13 tests/TC_FXListBox.rb
fxruby-1.6.14-universal-darwin-9 tests/TC_FXListBox.rb
fxruby-1.6.15-universal-darwin-9 tests/TC_FXListBox.rb
fxruby-1.6.14 tests/TC_FXListBox.rb
fxruby-1.6.15 tests/TC_FXListBox.rb
fxruby-1.6.15-x86-mswin32-60 tests/TC_FXListBox.rb
fxruby-1.6.16-universal-darwin-9 tests/TC_FXListBox.rb
fxruby-1.6.16-x86-mswin32-60 tests/TC_FXListBox.rb
fxruby-1.6.17-universal-darwin-9 tests/TC_FXListBox.rb
fxruby-1.6.16 tests/TC_FXListBox.rb