]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/frametest.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/frametest.cpp
3 // Purpose: wxFrame unit test
4 // Author: Steven Lamerton
6 // Copyright: (c) 2010 Steven Lamerton
7 ///////////////////////////////////////////////////////////////////////////////
20 #include "testableframe.h"
22 class FrameTestCase
: public CppUnit::TestCase
31 CPPUNIT_TEST_SUITE( FrameTestCase
);
32 CPPUNIT_TEST( Iconize
);
33 CPPUNIT_TEST( Close
);
34 CPPUNIT_TEST_SUITE_END();
41 DECLARE_NO_COPY_CLASS(FrameTestCase
)
44 // register in the unnamed registry so that these tests are run by default
45 CPPUNIT_TEST_SUITE_REGISTRATION( FrameTestCase
);
47 // also include in its own registry so that these tests can be run alone
48 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( FrameTestCase
, "FrameTestCase" );
50 void FrameTestCase::setUp()
52 m_frame
= new wxFrame(NULL
, wxID_ANY
, "test frame");
56 void FrameTestCase::tearDown()
61 void FrameTestCase::Iconize()
64 EventCounter
iconize(m_frame
, wxEVT_ICONIZE
);
67 m_frame
->Iconize(false);
69 CPPUNIT_ASSERT_EQUAL(2, iconize
.GetCount());
73 void FrameTestCase::Close()
75 EventCounter
close(m_frame
, wxEVT_CLOSE_WINDOW
);
79 CPPUNIT_ASSERT_EQUAL(1, close
.GetCount());