]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/frametest.cpp
4bee2246f2bff585381c2eec57044d7b322cc9f9
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/frametest.cpp
3 // Purpose: wxFrame unit test
4 // Author: Steven Lamerton
7 // Copyright: (c) 2010 Steven Lamerton
8 ///////////////////////////////////////////////////////////////////////////////
21 #include "testableframe.h"
23 class FrameTestCase
: public CppUnit::TestCase
32 CPPUNIT_TEST_SUITE( FrameTestCase
);
33 CPPUNIT_TEST( Iconize
);
34 CPPUNIT_TEST( Close
);
35 CPPUNIT_TEST_SUITE_END();
42 DECLARE_NO_COPY_CLASS(FrameTestCase
)
45 // register in the unnamed registry so that these tests are run by default
46 CPPUNIT_TEST_SUITE_REGISTRATION( FrameTestCase
);
48 // also include in its own registry so that these tests can be run alone
49 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( FrameTestCase
, "FrameTestCase" );
51 void FrameTestCase::setUp()
53 m_frame
= new wxFrame(NULL
, wxID_ANY
, "test frame");
57 void FrameTestCase::tearDown()
62 void FrameTestCase::Iconize()
65 EventCounter
iconize(m_frame
, wxEVT_ICONIZE
);
68 m_frame
->Iconize(false);
70 CPPUNIT_ASSERT_EQUAL(2, iconize
.GetCount());
74 void FrameTestCase::Close()
76 EventCounter
close(m_frame
, wxEVT_CLOSE_WINDOW
);
80 CPPUNIT_ASSERT_EQUAL(1, close
.GetCount());