require 'test/unit'

require 'fox'

include Fox

class TC_FXListBox < Test::Unit::TestCase
  def setup
    if FXApp.instance.nil?
      @app = FXApp.new('TC_FXListBox', 'FXRuby')
      @app.init([])
      @mainwin = FXMainWindow.new(@app, 'TC_FXListBox')
    else
      @app = FXApp.instance
      @mainwin = @app.mainWindow
    end
    @listBox = FXListBox.new(@mainwin, 1)
  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
end
