Sha256: d2f58b982a855671454a9a71503990d70e9af57f64d689644f0bbe541153a374

Contents?: true

Size: 1.54 KB

Versions: 6

Compression:

Stored size: 1.54 KB

Contents

require 'test/unit'
require 'testcase'
require 'fox12'

include Fox

class TC_FXRadioButton < TestCase
  def setup
    super(self.class.name)
    @radioButton = FXRadioButton.new(mainWindow, "cbText")
  end

  def test_setCheck_TRUE
    @radioButton.check = Fox::TRUE
    assert_equal(true, @radioButton.check)
    assert_equal(Fox::TRUE, @radioButton.checkState)
    assert(@radioButton.checked?)
    assert(!@radioButton.unchecked?)
    assert(!@radioButton.maybe?)
  end
  
  def test_setCheck_FALSE
    @radioButton.check = Fox::FALSE
    assert_equal(false, @radioButton.check)
    assert_equal(Fox::FALSE, @radioButton.checkState)
    assert(!@radioButton.checked?)
    assert(@radioButton.unchecked?)
    assert(!@radioButton.maybe?)
  end
  
  def test_setCheck_MAYBE
    @radioButton.check = Fox::MAYBE
    assert_equal(true, @radioButton.check) # this is not a typo!
    assert_equal(Fox::MAYBE, @radioButton.checkState)
    assert(!@radioButton.checked?)
    assert(!@radioButton.unchecked?)
    assert(@radioButton.maybe?)
  end
  
  def test_setCheck_true
    @radioButton.check = true
    assert_equal(true, @radioButton.check)
    assert_equal(Fox::TRUE, @radioButton.checkState)
    assert(@radioButton.checked?)
    assert(!@radioButton.unchecked?)
    assert(!@radioButton.maybe?)
  end
  
  def test_setCheck_false
    @radioButton.check = false
    assert_equal(false, @radioButton.check)
    assert_equal(Fox::FALSE, @radioButton.checkState)
    assert(!@radioButton.checked?)
    assert(@radioButton.unchecked?)
    assert(!@radioButton.maybe?)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fxruby-1.2.2 tests/TC_FXRadioButton.rb
fxruby-1.2.3 tests/TC_FXRadioButton.rb
fxruby-1.2.4 tests/TC_FXRadioButton.rb
fxruby-1.2.5 tests/TC_FXRadioButton.rb
fxruby-1.2.6 tests/TC_FXRadioButton.rb
fxruby-1.4.0 tests/TC_FXRadioButton.rb