root/lang/ruby/ruwin/test/ruwin/test_list_box.rb @ 28824

Revision 28824, 1.2 kB (checked in by isaisstillalive, 4 years ago)
  • テストモジュールのrequireパスを修正。
Line 
1require File.expand_path(File.join(File.dirname(__FILE__), "..", "helper"))
2require "ruwin"
3require "ruwin/list_box"
4require File.expand_path(File.join(File.dirname(__FILE__), "testm_list_box"))
5
6module TestModuleListBoxSingle
7  include TestModuleListBox
8 
9  def test_change_selection_singleton
10    @control.push "text1"
11    @control.push "text2"
12    @control.change_selection 0, true
13    @control.change_selection 1, true
14    assert_equal false, @control.selected?(0)
15    assert_equal true, @control.selected?(1)
16  end
17end
18
19class TestRuwinListBox < Test::Unit::TestCase
20  include TestModuleListBoxSingle
21  include Ruwin::Const::ListBox
22  TARGET_CLASS = Ruwin::ListBox
23 
24  def test_style
25    assert_equal 0, (@control.style&(LBS_MULTIPLESEL|LBS_EXTENDEDSEL))
26  end
27end
28
29class TestRuwinListBoxDropdown < Test::Unit::TestCase
30  include TestModuleListBoxSingle
31  include Ruwin::Const::ComboBox
32  TARGET_CLASS = Ruwin::ListBox::Dropdown
33 
34  def test_classname
35    assert_equal "COMBOBOX", @control.classname
36  end
37 
38  def test_style
39    assert_equal CBS_DROPDOWNLIST, (@control.style&(CBS_SIMPLE|CBS_DROPDOWN|CBS_DROPDOWNLIST))
40  end
41end
Note: See TracBrowser for help on using the browser.