Sha256: c4851da74a4b576f0a2881b2194009360043848bb0fa472b321665199ab11cb2

Contents?: true

Size: 1.06 KB

Versions: 100

Compression:

Stored size: 1.06 KB

Contents

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

class TC_FXListBox < Fox::TestCase
  include Fox

  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

100 entries across 100 versions & 1 rubygems

Version Path
fxruby-1.6.43-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.43-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.42 test/TC_FXListBox.rb
fxruby-1.6.42-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.42-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.41 test/TC_FXListBox.rb
fxruby-1.6.41-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.41-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.40-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.40-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.40 test/TC_FXListBox.rb
fxruby-1.6.39 test/TC_FXListBox.rb
fxruby-1.6.39-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.39-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.38 test/TC_FXListBox.rb
fxruby-1.6.38-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.38-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.38.pre1 test/TC_FXListBox.rb
fxruby-1.6.37 test/TC_FXListBox.rb
fxruby-1.6.37-x64-mingw32 test/TC_FXListBox.rb