Sha256: 7fbad449eaf5104d260f974ba5aa28f0155b4692ecc89b2ad3c8c7a5e26922d7

Contents?: true

Size: 1.04 KB

Versions: 17

Compression:

Stored size: 1.04 KB

Contents

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

include Fox

class TC_FXComboBox < TestCase
  def setup
    super(self.class.name)
    @comboBox = FXComboBox.new(mainWindow, 1)
  end

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

  def test_first
    assert_instance_of(FXTextField, @comboBox.first)
  end

  def test_children
    assert_instance_of(FXTextField, @comboBox.children[0])
    assert_instance_of(FXMenuButton, @comboBox.children[1])
  end
  
  def test_set_current_to_none
    assert_nothing_raised do
      @comboBox.currentItem = -1
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fxruby-1.6.14-mswin32 tests/TC_FXComboBox.rb
fxruby-1.6.13-mswin32 tests/TC_FXComboBox.rb
fxruby-1.6.1 tests/TC_FXComboBox.rb
fxruby-1.6.10 tests/TC_FXComboBox.rb
fxruby-1.6.11 tests/TC_FXComboBox.rb
fxruby-1.6.12 tests/TC_FXComboBox.rb
fxruby-1.6.13 tests/TC_FXComboBox.rb
fxruby-1.6.14-universal-darwin-9 tests/TC_FXComboBox.rb
fxruby-1.6.14 tests/TC_FXComboBox.rb
fxruby-1.6.2 tests/TC_FXComboBox.rb
fxruby-1.6.3 tests/TC_FXComboBox.rb
fxruby-1.6.4 tests/TC_FXComboBox.rb
fxruby-1.6.5 tests/TC_FXComboBox.rb
fxruby-1.6.6 tests/TC_FXComboBox.rb
fxruby-1.6.8 tests/TC_FXComboBox.rb
fxruby-1.6.7 tests/TC_FXComboBox.rb
fxruby-1.6.9 tests/TC_FXComboBox.rb