itemcontainertest.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: tests/controls/itemcontainertest.h
  3. // Purpose: wxItemContainer unit test
  4. // Author: Steven Lamerton
  5. // Created: 2010-06-29
  6. // Copyright: (c) 2010 Steven Lamerton
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_TESTS_CONTROLS_ITEMCONTAINERTEST_H_
  9. #define _WX_TESTS_CONTROLS_ITEMCONTAINERTEST_H_
  10. class ItemContainerTestCase
  11. {
  12. public:
  13. ItemContainerTestCase() { }
  14. virtual ~ItemContainerTestCase() { }
  15. protected:
  16. // this function must be overridden by the derived classes to return the
  17. // text entry object we're testing, typically this is done by creating a
  18. // control implementing wxItemContainer interface in setUp() virtual method and
  19. // just returning it from here
  20. virtual wxItemContainer *GetContainer() const = 0;
  21. // and this one must be overridden to return the window which implements
  22. // wxItemContainer interface -- usually it will return the same pointer as
  23. // GetTestEntry(), just as a different type
  24. virtual wxWindow *GetContainerWindow() const = 0;
  25. // this should be inserted in the derived class CPPUNIT_TEST_SUITE
  26. // definition to run all wxItemContainer tests as part of it
  27. #define wxITEM_CONTAINER_TESTS() \
  28. CPPUNIT_TEST( Append ); \
  29. CPPUNIT_TEST( Insert ); \
  30. CPPUNIT_TEST( Count ); \
  31. CPPUNIT_TEST( ItemSelection ); \
  32. CPPUNIT_TEST( FindString ); \
  33. CPPUNIT_TEST( ClientData ); \
  34. CPPUNIT_TEST( VoidData ); \
  35. CPPUNIT_TEST( Set ); \
  36. CPPUNIT_TEST( SetSelection ); \
  37. CPPUNIT_TEST( SetString )
  38. void Append();
  39. void Insert();
  40. void Count();
  41. void ItemSelection();
  42. void FindString();
  43. void ClientData();
  44. void VoidData();
  45. void Set();
  46. void SetSelection();
  47. void SetString();
  48. private:
  49. wxDECLARE_NO_COPY_CLASS(ItemContainerTestCase);
  50. };
  51. #endif // _WX_TESTS_CONTROLS_ITEMCONTAINERTEST_H_