]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/bitmaptogglebuttontest.cpp
Fixed capitalisation
[wxWidgets.git] / tests / controls / bitmaptogglebuttontest.cpp
index b6992aa7d13852c848ffced8e14e1ede3ba6c0c4..45e846b81e17de1ea4e8a05e02b52b2f2a44f7f5 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxBitmapToggleButton unit test
 // Author:      Steven Lamerton
 // Created:     2010-07-17
-// RCS-ID:      $Id$
 // Copyright:   (c) 2010 Steven Lamerton
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -52,7 +51,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( BitmapToggleButtonTestCase );
 
-// 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( BitmapToggleButtonTestCase,
                                       "BitmapToggleButtonTestCase" );
 
@@ -74,10 +73,7 @@ void BitmapToggleButtonTestCase::tearDown()
 void BitmapToggleButtonTestCase::Click()
 {
 #if wxUSE_UIACTIONSIMULATOR
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
-    EventCounter count(m_button, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED);
+    EventCounter clicked(m_button, wxEVT_TOGGLEBUTTON);
 
     wxUIActionSimulator sim;
 
@@ -88,25 +84,23 @@ void BitmapToggleButtonTestCase::Click()
     sim.MouseClick();
     wxYield();
 
-    CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
+    CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
     CPPUNIT_ASSERT(m_button->GetValue());
 
+    clicked.Clear();
     wxMilliSleep(1000);
 
     sim.MouseClick();
     wxYield();
 
-    CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
+    CPPUNIT_ASSERT_EQUAL(1, clicked.GetCount());
     CPPUNIT_ASSERT(!m_button->GetValue());
 #endif // wxUSE_UIACTIONSIMULATOR
 }
 
 void BitmapToggleButtonTestCase::Value()
 {
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
-    EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+    EventCounter clicked(m_button, wxEVT_BUTTON);
 
     m_button->SetValue(true);
 
@@ -116,7 +110,7 @@ void BitmapToggleButtonTestCase::Value()
 
     CPPUNIT_ASSERT(!m_button->GetValue());
 
-    CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() );
+    CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() );
 }
 
 #endif // wxHAS_BITMAPTOGGLEBUTTON