]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/pickerbasetest.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/pickerbasetest.cpp
3 // Purpose: wxPickerBase unit test
4 // Author: Steven Lamerton
6 // Copyright: (c) 2010 Steven Lamerton
7 ///////////////////////////////////////////////////////////////////////////////
11 #include "wx/pickerbase.h"
12 #include "pickerbasetest.h"
14 void PickerBaseTestCase::Margin()
16 wxPickerBase
* const base
= GetBase();
18 CPPUNIT_ASSERT(base
->HasTextCtrl());
19 CPPUNIT_ASSERT(base
->GetInternalMargin() >= 0);
21 base
->SetInternalMargin(15);
23 CPPUNIT_ASSERT_EQUAL(15, base
->GetInternalMargin());
26 void PickerBaseTestCase::Proportion()
28 wxPickerBase
* const base
= GetBase();
30 CPPUNIT_ASSERT(base
->HasTextCtrl());
32 base
->SetPickerCtrlProportion(1);
33 base
->SetTextCtrlProportion(1);
35 CPPUNIT_ASSERT_EQUAL(1, base
->GetPickerCtrlProportion());
36 CPPUNIT_ASSERT_EQUAL(1, base
->GetTextCtrlProportion());
39 void PickerBaseTestCase::Growable()
41 wxPickerBase
* const base
= GetBase();
43 CPPUNIT_ASSERT(base
->HasTextCtrl());
45 base
->SetPickerCtrlGrowable();
46 base
->SetTextCtrlGrowable();
48 CPPUNIT_ASSERT(base
->IsPickerCtrlGrowable());
49 CPPUNIT_ASSERT(base
->IsTextCtrlGrowable());
51 base
->SetPickerCtrlGrowable(false);
52 base
->SetTextCtrlGrowable(false);
54 CPPUNIT_ASSERT(!base
->IsPickerCtrlGrowable());
55 CPPUNIT_ASSERT(!base
->IsTextCtrlGrowable());
58 void PickerBaseTestCase::Controls()
60 wxPickerBase
* const base
= GetBase();
62 CPPUNIT_ASSERT(base
->HasTextCtrl());
63 CPPUNIT_ASSERT(base
->GetTextCtrl() != NULL
);
64 CPPUNIT_ASSERT(base
->GetPickerCtrl() != NULL
);