+void TextEntryTestCase::Editable()
+{
+#if wxUSE_UIACTIONSIMULATOR
+ wxTextEntry * const entry = GetTestEntry();
+ wxWindow * const window = GetTestWindow();
+
+ EventCounter updated(window, wxEVT_COMMAND_TEXT_UPDATED);
+
+ window->SetFocus();
+ wxYield();
+
+ wxUIActionSimulator sim;
+ sim.Text("abcdef");
+ wxYield();
+
+ CPPUNIT_ASSERT_EQUAL("abcdef", entry->GetValue());
+ CPPUNIT_ASSERT_EQUAL(6, updated.GetCount());
+
+ updated.Clear();
+
+ entry->SetEditable(false);
+ sim.Text("gh");
+ wxYield();
+
+ CPPUNIT_ASSERT_EQUAL("abcdef", entry->GetValue());
+ CPPUNIT_ASSERT_EQUAL(0, updated.GetCount());
+#endif
+}
+
+void TextEntryTestCase::Hint()
+{
+ GetTestEntry()->SetHint("This is a hint");
+ CPPUNIT_ASSERT_EQUAL("", GetTestEntry()->GetValue());
+}
+
+void TextEntryTestCase::CopyPaste()
+{
+#ifndef __WXOSX__
+ wxTextEntry * const entry = GetTestEntry();
+
+ entry->AppendText("sometext");
+ entry->SelectAll();
+
+ if(entry->CanCopy() && entry->CanPaste())
+ {
+ entry->Copy();
+ entry->Clear();
+ CPPUNIT_ASSERT(entry->IsEmpty());
+
+ wxYield();
+
+ entry->Paste();
+ CPPUNIT_ASSERT_EQUAL("sometext", entry->GetValue());
+ }
+#endif
+}
+
+void TextEntryTestCase::UndoRedo()
+{
+ wxTextEntry * const entry = GetTestEntry();
+
+ entry->AppendText("sometext");
+
+ if(entry->CanUndo())
+ {
+ entry->Undo();
+ CPPUNIT_ASSERT(entry->IsEmpty());
+
+ if(entry->CanRedo())
+ {
+ entry->Redo();
+ CPPUNIT_ASSERT_EQUAL("sometext", entry->GetValue());
+ }
+ }
+}