Update of /cvsroot/fxruby/FXRuby/tests
In directory usw-pr-cvs1:/tmp/cvs-serv30847
Added Files:
Tag: release10
TC_FXAccelTable.rb
Log Message:
Added a test case for FXAccelTable.
--- NEW FILE: TC_FXAccelTable.rb ---
require 'test/unit'
require 'fox'
include Fox
class TC_FXAccelTable < Test::Unit::TestCase
def set_up
@accel = FXAccelTable.new
end
def test_addAccel
hotkey = fxparsehotkey('&A')
target = FXObject.new
seldn, selup = 0, 0
@accel.addAccel(hotkey)
@accel.addAccel(hotkey, target)
@accel.addAccel(hotkey, target, seldn)
@accel.addAccel(hotkey, target, seldn, selup)
end
def test_hasAccel
hotkey = fxparsehotkey('&b')
assert(!@accel.hasAccel?(hotkey))
@accel.addAccel(hotkey)
assert(@accel.hasAccel?(hotkey))
end
def test_targetOfAccel
hotkey = fxparsehotkey("&x")
target = FXObject.new
@accel.addAccel(hotkey, target)
assert_same(target, @accel.targetOfAccel(hotkey))
end
def test_removeAccel
hotkey = fxparsehotkey('&b')
@accel.addAccel(hotkey)
assert(@accel.hasAccel?(hotkey))
@accel.removeAccel(hotkey)
assert(!@accel.hasAccel?(hotkey))
end
end
|