pickerbasetest.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include "testprec.h"
  9. #include "wx/pickerbase.h"
  10. #include "pickerbasetest.h"
  11. void PickerBaseTestCase::Margin()
  12. {
  13. wxPickerBase* const base = GetBase();
  14. CPPUNIT_ASSERT(base->HasTextCtrl());
  15. CPPUNIT_ASSERT(base->GetInternalMargin() >= 0);
  16. base->SetInternalMargin(15);
  17. CPPUNIT_ASSERT_EQUAL(15, base->GetInternalMargin());
  18. }
  19. void PickerBaseTestCase::Proportion()
  20. {
  21. wxPickerBase* const base = GetBase();
  22. CPPUNIT_ASSERT(base->HasTextCtrl());
  23. base->SetPickerCtrlProportion(1);
  24. base->SetTextCtrlProportion(1);
  25. CPPUNIT_ASSERT_EQUAL(1, base->GetPickerCtrlProportion());
  26. CPPUNIT_ASSERT_EQUAL(1, base->GetTextCtrlProportion());
  27. }
  28. void PickerBaseTestCase::Growable()
  29. {
  30. wxPickerBase* const base = GetBase();
  31. CPPUNIT_ASSERT(base->HasTextCtrl());
  32. base->SetPickerCtrlGrowable();
  33. base->SetTextCtrlGrowable();
  34. CPPUNIT_ASSERT(base->IsPickerCtrlGrowable());
  35. CPPUNIT_ASSERT(base->IsTextCtrlGrowable());
  36. base->SetPickerCtrlGrowable(false);
  37. base->SetTextCtrlGrowable(false);
  38. CPPUNIT_ASSERT(!base->IsPickerCtrlGrowable());
  39. CPPUNIT_ASSERT(!base->IsTextCtrlGrowable());
  40. }
  41. void PickerBaseTestCase::Controls()
  42. {
  43. wxPickerBase* const base = GetBase();
  44. CPPUNIT_ASSERT(base->HasTextCtrl());
  45. CPPUNIT_ASSERT(base->GetTextCtrl() != NULL);
  46. CPPUNIT_ASSERT(base->GetPickerCtrl() != NULL);
  47. }