[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] GUI test: 'paste_census' update
From: |
Greg Chicares |
Subject: |
[lmi] GUI test: 'paste_census' update |
Date: |
Mon, 14 Dec 2015 19:40:03 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 |
I've updated 'pasting_to_a_census.html', and would like to update its
unit test. I started out by replacing the example in the unit test with
the new user-manual example, but the kludges I had to add to make it
work gave me pause--see below. Perhaps it would be better to retain the
original example and add the new one, but I don't understand the test
well enough; Vadim, would you mind showing me how to do this better?
Index: wx_test_paste_census.cpp
===================================================================
--- wx_test_paste_census.cpp (revision 6443)
+++ wx_test_paste_census.cpp (working copy)
@@ -214,21 +214,20 @@
// internal column names actually used in the census data below.
std::set<std::string> column_titles;
column_titles.insert("Gender");
- column_titles.insert("Underwriting Class");
- column_titles.insert("Issue Age");
- column_titles.insert("Payment");
- column_titles.insert("Death Benefit Option");
+ column_titles.insert("Date Of Birth");
+ column_titles.insert("Employee Class");
+ column_titles.insert("Specified Amount");
char const* const census_data =
- "Gender\tUnderwritingClass\tIssueAge\tPayment\tDeathBenefitOption\n"
+ "Gender\tDateOfBirth\tEmployeeClass\tSpecifiedAmount\n"
"\n"
- "Female\tPreferred\t30\tsevenpay,7;0\tb,7;a\n"
- "Male\tPreferred\t35\tsevenpay,7;0\tb,7;a\n"
- "Female\tStandard\t40\tsevenpay,7;0\tb,7;a\n"
- "Male\tStandard\t45\tsevenpay,7;0\tb,7;a\n"
- "Female\tPreferred\t50\tsevenpay,7;0\tb,7;a\n"
- "Male\tPreferred\t55\tsevenpay,7;0\tb,7;a\n"
- "Female\tStandard\t60\tsevenpay,7;0\tb,7;a\n"
+ "Female\t19851231\tClerical\t100000, @65; 50000\n"
+ "Male\t19801130\tClerical\t200000, @65; 50000\n"
+ "Female\t19751029\tTechnical\t300000, @65; 50000\n"
+ "Male\t19700928\tTechnical\t400000, @65; 50000\n"
+ "Female\t19650827\tSupervisor\t500000, @65; 50000\n"
+ "Male\t19600726\tAttorney\t600000, @65; 75000\n"
+ "Female\t19550625\tPresident\t700000, @65; 100000\n"
;
std::size_t const number_of_rows = std::count
@@ -301,8 +300,12 @@
LMI_ASSERT(gender_radiobox);
wxUIActionSimulator ui;
- ui.Char(WXK_DOWN); // Select the last, "Unisex", radio button.
+ // Select the last, "Unisex", radio button, by simulating
+ // down-arrow twice: female --> male, then male --> unisex.
+ ui.Char(WXK_DOWN);
wxYield();
+ ui.Char(WXK_DOWN);
+ wxYield();
LMI_ASSERT_EQUAL(gender_radiobox->GetSelection(), 2);
@@ -337,7 +340,8 @@
unsigned int const
gender_column = find_model_column_by_title(list_window, "Gender");
LMI_ASSERT_EQUAL(list_model->GetCount(), number_of_rows);
- for(std::size_t row = 0; row < number_of_rows; ++row)
+ // Only the first two rows are affected. This seems fragile.
+ for(std::size_t row = 0; row < 2; ++row)
{
wxVariant value;
list_model->GetValueByRow(value, row, gender_column);
- [lmi] GUI test: 'paste_census' update,
Greg Chicares <=