Codebase list ruby-fxruby / e0d51cbb-e718-4249-9d88-9ac77d2a88f9/upstream/1.6.45+git20230102.1.821f5a9 test / TC_FXFoldingList.rb
e0d51cbb-e718-4249-9d88-9ac77d2a88f9/upstream/1.6.45+git20230102.1.821f5a9

Tree @e0d51cbb-e718-4249-9d88-9ac77d2a88f9/upstream/1.6.45+git20230102.1.821f5a9 (Download .tar.gz)

TC_FXFoldingList.rb @e0d51cbb-e718-4249-9d88-9ac77d2a88f9/upstream/1.6.45+git20230102.1.821f5a9raw · history · blame

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

class TC_FXFoldingList < Fox::TestCase
  include Fox


  def setup
    super(self.class.name)
    @foldingList = FXFoldingList.new(mainWindow)
  end

  def test_each_for_empty_list
    count = 0
    @foldingList.each { |item| count += 1 }
    assert_equal(0, count, "count for empty list should be zero")
  end

  def test_each
    @foldingList.appendItem(nil, "1")
    @foldingList.appendItem(nil, "2")
    @foldingList.appendItem(nil, "3")
    @foldingList.appendItem(nil, "4")
    @foldingList.appendItem(nil, "5")
    count = 0
    @foldingList.each { |item| count += 1 }
    assert_equal(5, count, "count didn't match expected number of items")
  end

end