>From 81327e8023bc326fd3cfac66d95cf4e7331586f6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 Mar 2015 00:11:41 +0100 Subject: [PATCH 2/3] Add wx_test_existing_illustration helper class. This is similar to the existing wx_test_new_illustration, but allows the tests to work easily with the existing illustration files and not new illustrations. --- wx_test_document.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/wx_test_document.hpp b/wx_test_document.hpp index 3fb75fb..6d89636 100644 --- a/wx_test_document.hpp +++ b/wx_test_document.hpp @@ -136,4 +136,31 @@ class wx_test_document_base bool opened_; }; +/// Represents an existing illustration document. +/// +/// Instantiating an object of this class simulates opening the specified +/// illustration. Its close() method must be called before destroying an object +/// of this class to ensure that it doesn't stay open. + +class wx_test_existing_illustration + :public wx_test_document_base +{ + public: + // Default constructor opens an illustration without changing the parameters. + explicit wx_test_existing_illustration(std::string const& file_ill) + { + wxUIActionSimulator ui; + ui.Char('o', wxMOD_CONTROL); // "File|Open" + + wxTEST_DIALOG + (wxYield() + ,wxExpectModal(file_ill) + ,wxExpectDismissableModal(wxID_OK) + .Describe("illustration properties for " + file_ill) + ); + + set_opened(); + } +}; + #endif // wx_test_document_hpp -- 2.1.0