Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
using doTable i.s.o. doTables where possible
  • Loading branch information
MartinGijsen committed Jul 8, 2013
1 parent ecd0b8d commit a569f16
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/fit/decorator/CopyAndAppendLastRowTest.java
Expand Up @@ -2,7 +2,6 @@

import java.text.ParseException;

import fit.Dispatcher;
import fit.Parse;
import fit.decorator.exceptions.InvalidInputException;
import fit.decorator.util.TestCaseHelper;
Expand Down Expand Up @@ -38,8 +37,7 @@ public void testSetupDecoratorShouldAddCounterToSummary() throws Exception {

public void testShouldLeaveTableAsItIsIfCounterValueIsZero() throws Exception {
String fitPage = "<table>" + FIRST_HTML_ROW + "<tr><td>fit.decorator.TestFixture</td></tr></table>";
Dispatcher dispatcher = new Dispatcher();
dispatcher.doTables(new Parse(fitPage));
decorator.doTable(new Parse(fitPage));
TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), decorator.counts);
}

Expand All @@ -48,18 +46,16 @@ public void testShouldAddOneRowIfCounterValueIsOne() throws Exception {
+ "</td><td>times</td></tr><tr><td>eg.Division</td></tr>"
+ "<tr><td>numerator</td><td>denominator</td><td>quotient()</td></tr>"
+ "<tr><td>10</td><td>2</td><td>5</td></tr></table>";
Dispatcher dispatcher = new Dispatcher();
dispatcher.doTables(new Parse(fitPage));
TestCaseHelper.assertCounts(TestCaseHelper.counts(2, 0, 0, 0), dispatcher.counts);
decorator.doTable(new Parse(fitPage));
TestCaseHelper.assertCounts(TestCaseHelper.counts(2, 0, 0, 0), decorator.counts);
}

public void testShouldLeaveTableAsItIsIfTotalRowsAreLessThanThree() throws Exception {
String fitPage = "<table><tr><td>" + CopyAndAppendLastRow.class.getName() + "</td>"
+ "<td>0</td><td>times</td></tr><tr><td>eg.Division</td></tr>"
+ "<tr><td>numerator</td><td>denominator</td><td>quotient()</td></tr></table>";
Dispatcher dispatcher = new Dispatcher();
dispatcher.doTables(new Parse(fitPage));
TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), dispatcher.counts);
decorator.doTable(new Parse(fitPage));
TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), decorator.counts);
}

public void testShouldAppendLastRowCounterNumberOfTimes() throws Exception {
Expand Down

0 comments on commit a569f16

Please sign in to comment.