|
Revision 28824, 1.2 kB
(checked in by isaisstillalive, 4 years ago)
|
|
|
| Line | |
|---|
| 1 | require File.expand_path(File.join(File.dirname(__FILE__), "..", "helper"))
|
|---|
| 2 | require "ruwin"
|
|---|
| 3 | require "ruwin/list_box"
|
|---|
| 4 | require File.expand_path(File.join(File.dirname(__FILE__), "testm_list_box"))
|
|---|
| 5 |
|
|---|
| 6 | module 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
|
|---|
| 17 | end
|
|---|
| 18 |
|
|---|
| 19 | class 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
|
|---|
| 27 | end
|
|---|
| 28 |
|
|---|
| 29 | class 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
|
|---|
| 41 | end
|
|---|