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