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.48 test/TC_FXListBox.rb
fxruby-1.6.48-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.48-x64-mingw-ucrt test/TC_FXListBox.rb
fxruby-1.6.48-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.47 test/TC_FXListBox.rb
fxruby-1.6.47-x64-mingw-ucrt test/TC_FXListBox.rb
fxruby-1.6.47-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.47-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.46 test/TC_FXListBox.rb
fxruby-1.6.46-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.46-x64-mingw-ucrt test/TC_FXListBox.rb
fxruby-1.6.46-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.45 test/TC_FXListBox.rb
fxruby-1.6.45-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.45-x64-mingw-ucrt test/TC_FXListBox.rb
fxruby-1.6.45-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.44 test/TC_FXListBox.rb
fxruby-1.6.44-x64-mingw32 test/TC_FXListBox.rb
fxruby-1.6.44-x86-mingw32 test/TC_FXListBox.rb
fxruby-1.6.43 test/TC_FXListBox.rb