Sha256: a7eb64432a9f4e62a3ece96c92f1ac3a0f357d7a42913e64a52a93643b1866ad

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

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

class TC_FXMenuCheck < Fox::TestCase
  include Fox

  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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fxruby-1.6.22.pre2-x86-mingw32 test/TC_FXMenuCheck.rb
fxruby-1.6.22.pre2 test/TC_FXMenuCheck.rb
fxrubi-1.6.22.pre1-x86-mingw32 test/TC_FXMenuCheck.rb
fxrubi-1.6.22.pre1 test/TC_FXMenuCheck.rb