Package fitnesse.fixtures

Source Code of fitnesse.fixtures.PageDriverTest

package fitnesse.fixtures;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import fitnesse.http.MockResponseSender;


public class PageDriverTest {

  PageDriver pageDriver;

  @Before
  public void setup() throws Exception {
    pageDriver = new PageDriver();
    FitnesseFixtureContext.sender = new MockResponseSender();
    FitnesseFixtureContext.sender.send("\r\n\r\n<asdf id=\"123_\" /><asdf id=\"125_\" />".getBytes());
  }

  @Test
  public void idPrefixTagCount() throws Exception {
    assertEquals(0, pageDriver.countOfTagWithIdPrefix("asdf", null));
    assertEquals(0, pageDriver.countOfTagWithIdPrefix("asdf", "124"));
    assertEquals(0, pageDriver.countOfTagWithIdPrefix("blah", "123"));

    assertEquals(1, pageDriver.countOfTagWithIdPrefix("asdf", "123"));
    assertEquals(2, pageDriver.countOfTagWithIdPrefix("asdf", "12"));
  }

}
TOP

Related Classes of fitnesse.fixtures.PageDriverTest

TOP
Copyright © 2018 www.massapi.com. 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.