]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: tests/controls/pickerbasetest.cpp | |
3 | // Purpose: wxPickerBase unit test | |
4 | // Author: Steven Lamerton | |
5 | // Created: 2010-08-07 | |
6 | // Copyright: (c) 2010 Steven Lamerton | |
7 | /////////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #include "testprec.h" | |
10 | ||
11 | #include "wx/pickerbase.h" | |
12 | #include "pickerbasetest.h" | |
13 | ||
14 | void PickerBaseTestCase::Margin() | |
15 | { | |
16 | wxPickerBase* const base = GetBase(); | |
17 | ||
18 | CPPUNIT_ASSERT(base->HasTextCtrl()); | |
19 | CPPUNIT_ASSERT(base->GetInternalMargin() >= 0); | |
20 | ||
21 | base->SetInternalMargin(15); | |
22 | ||
23 | CPPUNIT_ASSERT_EQUAL(15, base->GetInternalMargin()); | |
24 | } | |
25 | ||
26 | void PickerBaseTestCase::Proportion() | |
27 | { | |
28 | wxPickerBase* const base = GetBase(); | |
29 | ||
30 | CPPUNIT_ASSERT(base->HasTextCtrl()); | |
31 | ||
32 | base->SetPickerCtrlProportion(1); | |
33 | base->SetTextCtrlProportion(1); | |
34 | ||
35 | CPPUNIT_ASSERT_EQUAL(1, base->GetPickerCtrlProportion()); | |
36 | CPPUNIT_ASSERT_EQUAL(1, base->GetTextCtrlProportion()); | |
37 | } | |
38 | ||
39 | void PickerBaseTestCase::Growable() | |
40 | { | |
41 | wxPickerBase* const base = GetBase(); | |
42 | ||
43 | CPPUNIT_ASSERT(base->HasTextCtrl()); | |
44 | ||
45 | base->SetPickerCtrlGrowable(); | |
46 | base->SetTextCtrlGrowable(); | |
47 | ||
48 | CPPUNIT_ASSERT(base->IsPickerCtrlGrowable()); | |
49 | CPPUNIT_ASSERT(base->IsTextCtrlGrowable()); | |
50 | ||
51 | base->SetPickerCtrlGrowable(false); | |
52 | base->SetTextCtrlGrowable(false); | |
53 | ||
54 | CPPUNIT_ASSERT(!base->IsPickerCtrlGrowable()); | |
55 | CPPUNIT_ASSERT(!base->IsTextCtrlGrowable()); | |
56 | } | |
57 | ||
58 | void PickerBaseTestCase::Controls() | |
59 | { | |
60 | wxPickerBase* const base = GetBase(); | |
61 | ||
62 | CPPUNIT_ASSERT(base->HasTextCtrl()); | |
63 | CPPUNIT_ASSERT(base->GetTextCtrl() != NULL); | |
64 | CPPUNIT_ASSERT(base->GetPickerCtrl() != NULL); | |
65 | } |