require 'test/unit'

require 'fox'

include Fox

class TC_FXMenuCommand < Test::Unit::TestCase
  def setup
    if FXApp.instance.nil?
      @app = FXApp.new('TC_FXMenuCommand', 'FXRuby')
      @app.init([])
      @mainwin = FXMainWindow.new(@app, 'TC_FXMenuCommand')
    else
      @app = FXApp.instance
      @mainwin = @app.mainWindow
    end
    @menuCommand = FXMenuCommand.new(@mainwin, "menuCommand")
  end
  
  def test_checked?
    @menuCommand.check
    assert(@menuCommand.checked?)
    @menuCommand.uncheck
    assert(!@menuCommand.checked?)
  end
  
  def test_radioChecked?
    @menuCommand.checkRadio
    assert(@menuCommand.radioChecked?)
    @menuCommand.uncheckRadio
    assert(!@menuCommand.radioChecked?)
  end
end
