October 2000
Intermediate to advanced
288 pages
5h 45m
English
Write testN(), with, say, five items. It will also pass.
What else can give you problems? One possible problem occurs when we do a sequence of queries—can we get "leftovers"? For example, a query returning five items followed by a query returning three items should have only three items in the table. (If the table were improperly cleared, we might see the last two items of the previous query.)
We can test a sequence of queries:
public void testQuerySequenceForLeftovers() { SearchPanel sp = new SearchPanel(); sp.setSearcher (new TestSearcher()); sp.queryField.setText("5"); sp.findButton.doClick(); assert(sp.resultTable.getRowCount() == 5); sp.queryField.setText("3"); sp.findButton.doClick(); assert(sp.resultTable.getRowCount() ...Read now
Unlock full access