Package fit

Examples of fit.Parse


  public void testShouldAddOneRowIfCounterValueIsOne() throws Exception {
    String fitPage = "<table><tr><td>" + CopyAndAppendLastRow.class.getName() + "</td><td>1"
      + "</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>";
    decorator.doTables(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(2, 0, 0, 0), decorator.counts);
  }
View Full Code Here


  @Test
  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>";
    decorator.doTables(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(0, 0, 0, 0), decorator.counts);
  }
View Full Code Here

  public void testShouldAppendLastRowCounterNumberOfTimes() throws Exception {
    String fitPage = "<table><tr><td>" + CopyAndAppendLastRow.class.getName() + "</td><td>" + COUNTER
      + "</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>";
    decorator.doTable(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(COUNTER + 1, 0, 0, 0), decorator.counts);
  }
View Full Code Here

    String fitPage = "<table><tr><td>" + CopyAndAppendLastRow.class.getName() + "</td><td>" + COUNTER
      + "</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><tr><td>12.6</td><td>3</td><td>4.2</td></tr>"
      + "<tr><td>100</td><td>4</td><td>25</td></tr></table>";
    decorator.doTable(new Parse(fitPage));
    TestCaseHelper.assertCounts(TestCaseHelper.counts(COUNTER + 3, 0, 0, 0), decorator.counts);
  }
View Full Code Here

  public void testRunShouldMeasureTimeTakenToExecuteDoTableMethodOnGivenFixture() throws Exception {
    String fitPage = "<table><tr><td>eg.Division</td></tr>"
      + "<tr><td>numerator</td><td>denominator</td><td>quotient()</td></tr>"
      + "<tr><td>100</td><td>4</td><td>25</td></tr></table>";
    MaxTime fixture = new MaxTime(stopWatch);
    fixture.run(new ColumnFixture(), new Parse(fitPage));
    assertEquals(ELAPSED, ((Long) fixture.summary.get(MaxTime.ACTUAL_TIME_TAKEN)).longValue());
  }
View Full Code Here

public class ScoreGameTest {
  @Test
  public void test() throws Exception {
    ScoreGame sg = new ScoreGame();
    Parse table = new Parse(
      "<table>" +
        "<tr><td>ScoreGame</td></tr>" +
        "<tr>" +
        "<td>1-1</td>\n" +
        "<td>1-2</td>\n" +
View Full Code Here

        "    </tr>",
        "</table>"});

    String tableText = StringUtils.join(tableLines, "\r\n");

    Parse tableForFaultyFixture = new Parse(tableText);

    new Fixture().doTables(tableForFaultyFixture);
    String fixtureClassCellText = tableForFaultyFixture.at(0, 0, 0).body;

    assertEquals("fit.testFxtr.WouldBeFixture<hr/> "
      + "<span class=\"fit_label\">"
      + "Class fit.testFxtr.WouldBeFixture is not a fixture." + "</span>",
      fixtureClassCellText);
View Full Code Here

import fit.Fixture;
import fit.Parse;

public class OutputWritingFixture extends Fixture {
  public void doTable(Parse parse) {
    Parse cell = parse.parts.more.parts;
    String value = cell.text();
    System.out.println(value);
    right(cell);
  }
View Full Code Here

import fit.Fixture;
import fit.Parse;

public class ErrorWritingFixture extends Fixture {
  public void doTable(Parse parse) {
    Parse cell = parse.parts.more.parts;
    String value = cell.text();
    System.err.println(value);
    right(cell);
  }
View Full Code Here

import fit.Parse;

public class EchoFixture extends Fixture {
  public void doTable(Parse table) {
    String text = getArgs()[0];
    table.parts.parts = new Parse("tr", "", new Parse("td", text, null, null), null);
  }
View Full Code Here

TOP

Related Classes of fit.Parse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.