]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/pickerbasetest.cpp
a4a70785b34ce076fb06208cc01eedff3caad682
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/pickerbasetest.cpp
3 // Purpose: wxPickerBase unit test
4 // Author: Steven Lamerton
7 // Copyright: (c) 2010 Steven Lamerton
8 ///////////////////////////////////////////////////////////////////////////////
12 #include "wx/pickerbase.h"
13 #include "pickerbasetest.h"
15 void PickerBaseTestCase::Margin()
17 wxPickerBase
* const base
= GetBase();
19 CPPUNIT_ASSERT(base
->HasTextCtrl());
20 CPPUNIT_ASSERT(base
->GetInternalMargin() >= 0);
22 base
->SetInternalMargin(15);
24 CPPUNIT_ASSERT_EQUAL(15, base
->GetInternalMargin());
27 void PickerBaseTestCase::Proportion()
29 wxPickerBase
* const base
= GetBase();
31 CPPUNIT_ASSERT(base
->HasTextCtrl());
33 base
->SetPickerCtrlProportion(1);
34 base
->SetTextCtrlProportion(1);
36 CPPUNIT_ASSERT_EQUAL(1, base
->GetPickerCtrlProportion());
37 CPPUNIT_ASSERT_EQUAL(1, base
->GetTextCtrlProportion());
40 void PickerBaseTestCase::Growable()
42 wxPickerBase
* const base
= GetBase();
44 CPPUNIT_ASSERT(base
->HasTextCtrl());
46 base
->SetPickerCtrlGrowable();
47 base
->SetTextCtrlGrowable();
49 CPPUNIT_ASSERT(base
->IsPickerCtrlGrowable());
50 CPPUNIT_ASSERT(base
->IsTextCtrlGrowable());
52 base
->SetPickerCtrlGrowable(false);
53 base
->SetTextCtrlGrowable(false);
55 CPPUNIT_ASSERT(!base
->IsPickerCtrlGrowable());
56 CPPUNIT_ASSERT(!base
->IsTextCtrlGrowable());
59 void PickerBaseTestCase::Controls()
61 wxPickerBase
* const base
= GetBase();
63 CPPUNIT_ASSERT(base
->HasTextCtrl());
64 CPPUNIT_ASSERT(base
->GetTextCtrl() != NULL
);
65 CPPUNIT_ASSERT(base
->GetPickerCtrl() != NULL
);