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

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


  public Function lastName() {
    return new NameFunction(LAST);
  }

  public Function beforeDate(String source, SimpleDateFormat format) {
    return new DateTimeFunction(toCalendar(source, format), BEFORE);
  }
View Full Code Here


  public Function beforeDate(String source, SimpleDateFormat format) {
    return new DateTimeFunction(toCalendar(source, format), BEFORE);
  }
 
  public Function afterDate(String source, SimpleDateFormat format) {
    return new DateTimeFunction(toCalendar(source, format), AFTER);
  }
View Full Code Here

  public Function afterDate(String source, SimpleDateFormat format) {
    return new DateTimeFunction(toCalendar(source, format), AFTER);
  }
 
  public Function randomDate(String startDate, String endDate, DateFormat format) {
    return new DateTimeFunction(toCalendar(startDate, format), toCalendar(endDate, format));
  }
View Full Code Here

  private static DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
 
  @Test
  public void afterDate() {
    String source = "2011-04-07";
    Calendar value = new DateTimeFunction(toCalendar(source, format), DateType.AFTER).generateValue();
    assertNotNull("Generated date can not be null", value);
    assertTrue(String.format("Generated date is not after %s", source), value.after(toCalendar(source, format)));
  }
View Full Code Here

  }

  @Test
  public void beforeDate() {
    String source = "2011-04-07";
    Calendar value = new DateTimeFunction(toCalendar(source, format), DateType.BEFORE).generateValue();
    assertNotNull("Generated date can not be null", value);
    assertTrue(String.format("Generated date is not before %s", source), value.before(toCalendar(source, format)));
  }
View Full Code Here

    assertTrue(String.format("Generated date is not before %s", source), value.before(toCalendar(source, format)));
  }
  @Test
  public void randomDate() {
    String start = "2011-04-01", end = "2011-04-30";
    Calendar value = new DateTimeFunction(toCalendar(start, format), toCalendar(end, format)).generateValue();
    assertNotNull("Generated date can not be null", value);
    assertTrue(String.format("Generated date is not between %s and %s", start, end), toCalendar(start, format).before(value) && value.before(toCalendar(end, format)));
  }
View Full Code Here

TOP

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

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.