// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION( ToggleButtonTestCase );
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ToggleButtonTestCase, "ToggleButtonTestCase" );
void ToggleButtonTestCase::setUp()
void ToggleButtonTestCase::Click()
{
#if wxUSE_UIACTIONSIMULATOR
- wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
- wxTestableFrame);
-
- EventCounter count(m_button, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED);
+ EventCounter clicked(m_button, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED);
wxUIActionSimulator sim;
sim.MouseClick();
wxYield();
- CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
+ CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
CPPUNIT_ASSERT(m_button->GetValue());
+ clicked.Clear();
sim.MouseClick();
wxYield();
- CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
+ CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
CPPUNIT_ASSERT(!m_button->GetValue());
#endif
}
void ToggleButtonTestCase::Value()
{
- wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
- wxTestableFrame);
-
- EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+ EventCounter clicked(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
m_button->SetValue(true);
CPPUNIT_ASSERT(!m_button->GetValue());
- CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() );
+ CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() );
}
#endif //wxUSE_TOGGLEBTN