Package br.com.six2six.fixturefactory.function.impl

Examples of br.com.six2six.fixturefactory.function.impl.RegexFunction


  public Function randomDate(String startDate, String endDate, DateFormat format) {
    return new DateTimeFunction(toCalendar(startDate, format), toCalendar(endDate, format));
  }

  public Function regex(String regex) {
    return new RegexFunction(regex);
  }
View Full Code Here


public class RegexFunctionTest {

  @Test
  public void regexString() {
    String pattern = "\\w{8}";
    String value = new RegexFunction(pattern).generateValue();
    assertNotNull("Generated string can not be null", value);
    assertTrue(String.format("Generated string no match with %s", pattern), value.matches(pattern));
  }
View Full Code Here

  }
 
  @Test
  public void regexNumber() {
    String pattern = "\\d{3,8}";
    String value = new RegexFunction(pattern).generateValue();
    assertNotNull("Generated number can not be null", value);
    assertTrue(String.format("Generated number no match with %s", pattern), value.matches(pattern));
  }
View Full Code Here

  }

  @Test
  public void regexPhoneNumber() {
    String pattern = "(\\d{2})-(\\d{4})-(\\d{4})";
    String value = new RegexFunction(pattern).generateValue();
    assertNotNull("Generated phone number can not be null", value);
    assertTrue(String.format("Generated phone number no match with %s", pattern), value.matches(pattern));
  }
View Full Code Here

TOP

Related Classes of br.com.six2six.fixturefactory.function.impl.RegexFunction

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.