]> git.saurik.com Git - wxWidgets.git/blame - tests/controls/bookctrlbasetest.h
Add a minimal unit test for wxSimplebook.
[wxWidgets.git] / tests / controls / bookctrlbasetest.h
CommitLineData
232fdc63
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: tests/controls/bookctrlbasetest.cpp
3// Purpose: wxBookCtrlBase unit test
4// Author: Steven Lamerton
5// Created: 2010-07-02
6// RCS-ID: $Id$
7// Copyright: (c) 2010 Steven Lamerton
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_
11#define _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_
12
13class BookCtrlBaseTestCase
14{
15public:
16 BookCtrlBaseTestCase() { }
17 virtual ~BookCtrlBaseTestCase() { }
18
19protected:
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 wxBookCtrlBase interface in setUp() virtual method and
23 // just returning it from here
24 virtual wxBookCtrlBase *GetBase() const = 0;
25
26 virtual wxEventType GetChangedEvent() const = 0;
27
28 virtual wxEventType GetChangingEvent() const = 0;
29
30 // this should be inserted in the derived class CPPUNIT_TEST_SUITE
31 // definition to run all wxBookCtrlBase tests as part of it
32 #define wxBOOK_CTRL_BASE_TESTS() \
33 CPPUNIT_TEST( Selection ); \
34 CPPUNIT_TEST( Text ); \
35 CPPUNIT_TEST( PageManagement ); \
36 CPPUNIT_TEST( ChangeEvents )
37
38 void Selection();
39 void Text();
40 void PageManagement();
41 void ChangeEvents();
42
43 //You need to add CPPUNIT_TEST( Image ) specifically if you want it to be
44 //tested as only wxNotebook and wxTreebook support images correctly
45 void Image();
46
47 //Call this from the setUp function of a specific test to add panels to
48 //the ctrl.
49 void AddPanels();
50
51 wxPanel* m_panel1;
52 wxPanel* m_panel2;
53 wxPanel* m_panel3;
54
55 wxImageList* m_list;
56
57private:
58 wxDECLARE_NO_COPY_CLASS(BookCtrlBaseTestCase);
59};
60
61#endif // _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_