Sha256: 78d04f9a924c80f1d6b6973931025d1fcc041383fd69a089f3fc619c6a6ef94b

Contents?: true

Size: 1.88 KB

Versions: 36

Compression:

Stored size: 1.88 KB

Contents

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

include Fox

class TC_FXHeader < TestCase

  def setup
    super(self.class.name)
    @header = FXHeader.new(mainWindow, nil, 0, HEADER_NORMAL)
  end

  def test_setArrowDir
    @header.appendItem("")
    @header.setArrowDir(0, true)
    @header.setArrowDir(0, false)
    @header.setArrowDir(0, Fox::TRUE)
    @header.setArrowDir(0, Fox::FALSE)
    @header.setArrowDir(0, Fox::MAYBE)
  end

  def test_getArrowDir
    @header.appendItem("")
    assert_instance_of(Fixnum, @header.getArrowDir(0))
  end

  def test_arrowUp?
    @header.appendItem("")
    assert_same(false, @header.arrowUp?(0))
    @header.setArrowDir(0, Fox::TRUE)
    assert_same(true, @header.arrowUp?(0))
  end

  def test_arrowDown?
    @header.appendItem("")
    assert_same(false, @header.arrowDown?(0))
    @header.setArrowDir(0, Fox::FALSE)
    assert_same(true, @header.arrowDown?(0))
  end

  def test_arrowMaybe?
    @header.appendItem("")
    assert_same(true, @header.arrowMaybe?(0))
    @header.setArrowDir(0, Fox::MAYBE)
    assert_same(true, @header.arrowMaybe?(0))
  end
  
  def test_SEL_REPLACED
    @header.appendItem("One")
    @header.appendItem("Two")
    itemIndex = 0
    @header.connect(SEL_REPLACED) { |sender, sel, ptr|
      itemIndex = ptr
    }
    @header.setItem(1, "", nil, 0, nil, true)
    assert_equal(1, itemIndex)
  end
  
  def test_SEL_INSERTED
    @header.appendItem("One")
    @header.appendItem("Two")
    itemIndex = 0
    @header.connect(SEL_INSERTED) { |sender, sel, ptr|
      itemIndex = ptr
    }
    @header.insertItem(1, "One Point Five", nil, 0, nil, true)
    assert_equal(1, itemIndex)
  end
  
  def test_SEL_DELETED
    @header.appendItem("One")
    @header.appendItem("Two")
    itemIndex = 0
    @header.connect(SEL_DELETED) { |sender, sel, ptr|
      itemIndex = ptr
    }
    @header.removeItem(1, true)
    assert_equal(1, itemIndex)
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
fxruby-1.6.20-x86-mingw32 test/TC_FXHeader.rb
fxruby-1.6.20-x86-linux test/TC_FXHeader.rb
fxruby-1.6.20 test/TC_FXHeader.rb
fxruby-1.6.20-universal-darwin-10 test/TC_FXHeader.rb
fxruby-1.6.19-x86-mingw32 tests/TC_FXHeader.rb
fxruby-1.6.14-mswin32 tests/TC_FXHeader.rb
fxruby-1.6.13-mswin32 tests/TC_FXHeader.rb
fxruby-1.6.10 tests/TC_FXHeader.rb
fxruby-1.6.11 tests/TC_FXHeader.rb
fxruby-1.6.12 tests/TC_FXHeader.rb
fxruby-1.6.13 tests/TC_FXHeader.rb
fxruby-1.6.14-universal-darwin-9 tests/TC_FXHeader.rb
fxruby-1.6.15-universal-darwin-9 tests/TC_FXHeader.rb
fxruby-1.6.14 tests/TC_FXHeader.rb
fxruby-1.6.15 tests/TC_FXHeader.rb
fxruby-1.6.15-x86-mswin32-60 tests/TC_FXHeader.rb
fxruby-1.6.16-universal-darwin-9 tests/TC_FXHeader.rb
fxruby-1.6.16-x86-mswin32-60 tests/TC_FXHeader.rb
fxruby-1.6.16 tests/TC_FXHeader.rb
fxruby-1.6.17-universal-darwin-9 tests/TC_FXHeader.rb