|
Revision 28816, 0.8 kB
(checked in by isaisstillalive, 4 years ago)
|
- Controlはfactoryではなくnewで初期化。
|
| Line | |
|---|
| 1 | require File.expand_path(File.join(File.dirname(__FILE__), "..", "helper"))
|
|---|
| 2 | require "ruwin/control"
|
|---|
| 3 |
|
|---|
| 4 | class TestRuwinControl < Test::Unit::TestCase
|
|---|
| 5 | include Ruwin::Const::Window
|
|---|
| 6 |
|
|---|
| 7 | DummyMSG = Struct.new(:hWnd, :msg, :wParam, :lParam)
|
|---|
| 8 |
|
|---|
| 9 | def test_inherit
|
|---|
| 10 | baseklass = Class.new(Ruwin::Control)
|
|---|
| 11 | klass = baseklass.inherit("NAME"){ style 16 }
|
|---|
| 12 | assert_equal -1, (klass <=> baseklass)
|
|---|
| 13 | assert_equal 16, klass.style
|
|---|
| 14 | end
|
|---|
| 15 |
|
|---|
| 16 | def test_new
|
|---|
| 17 | klass = Class.new(Ruwin::Control)
|
|---|
| 18 | window = Ruwin::Component.factory
|
|---|
| 19 | instance = klass.new(window)
|
|---|
| 20 | assert_equal 0, instance.style&WS_CLIPSIBLINGS
|
|---|
| 21 | assert_equal 0, instance.style&WS_OVERLAPPEDWINDOW
|
|---|
| 22 | assert_equal WS_VISIBLE, instance.style&WS_VISIBLE
|
|---|
| 23 | assert_equal WS_CHILD, instance.style&WS_CHILD
|
|---|
| 24 | end
|
|---|
| 25 | end
|
|---|