Newer
Older
require 'test/unit'
require 'testcase'
require 'fox16'
class TC_FXMenuCheck < Fox::TestCase
include Fox
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
def setup
super(self.class.name)
@menuCheck = FXMenuCheck.new(mainWindow, "menuCheck")
end
def test_setCheck_TRUE
@menuCheck.check = Fox::TRUE
assert_equal(true, @menuCheck.check)
assert_equal(Fox::TRUE, @menuCheck.checkState)
assert(@menuCheck.checked?)
assert(!@menuCheck.unchecked?)
assert(!@menuCheck.maybe?)
end
def test_setCheck_FALSE
@menuCheck.check = Fox::FALSE
assert_equal(false, @menuCheck.check)
assert_equal(Fox::FALSE, @menuCheck.checkState)
assert(!@menuCheck.checked?)
assert(@menuCheck.unchecked?)
assert(!@menuCheck.maybe?)
end
def test_setCheck_MAYBE
@menuCheck.check = Fox::MAYBE
assert_equal(true, @menuCheck.check) # this is not a typo!
assert_equal(Fox::MAYBE, @menuCheck.checkState)
assert(!@menuCheck.checked?)
assert(!@menuCheck.unchecked?)
assert(@menuCheck.maybe?)
end
def test_setCheck_true
@menuCheck.check = true
assert_equal(true, @menuCheck.check)
assert_equal(Fox::TRUE, @menuCheck.checkState)
assert(@menuCheck.checked?)
assert(!@menuCheck.unchecked?)
assert(!@menuCheck.maybe?)
end
def test_setCheck_false
@menuCheck.check = false
assert_equal(false, @menuCheck.check)
assert_equal(Fox::FALSE, @menuCheck.checkState)
assert(!@menuCheck.checked?)
assert(@menuCheck.unchecked?)
assert(!@menuCheck.maybe?)
end
end