Examples of BasicErrorMessageFactory


Examples of org.fest.assertions.error.BasicErrorMessageFactory

  }

  void assertHasSize(Description description, Object array, int expectedSize) {
    assertNotNull(description, array);
    if (expectedSize < 0) {
      throw failures.failure(description, new BasicErrorMessageFactory("The expectedSize should not be negative"));
    }
    int sizeOfActual = sizeOf(array);
    if (sizeOfActual != expectedSize) {
      throw failures.failure(description, shouldHaveSize(array, sizeOfActual, expectedSize));
    }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

    boolean firstFound = false;
    int index = 0;

    if (sizeOfActual < sizeOfSequence) {
      String format = "The size of sequence is greater than the size of array";
      throw failures.failure(description, new BasicErrorMessageFactory(format, array, sequence));
    }
    for (int i = 0; i < sizeOfActual && index < sizeOfSequence; i++) {
      if (areEqual(Array.get(array, i), Array.get(sequence, index))) {
        firstFound = true;
        index++;
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

   */
  public <T> void assertIs(Description description, T actual, Matcher<? super T> matcher) {
    checkNotNull(matcher);
    if (!matcher.matches(actual)) {
      String format = "expecting:<%s> to be:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, matcher));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

   */
  public <T> void assertIsNot(Description description, T actual, Matcher<? super T> matcher) {
    checkNotNull(matcher);
    if (matcher.matches(actual)) {
      String format = "expecting:<%s> not to be:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, matcher));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

   */
  public <T> void assertHas(Description description, T actual, Matcher<? super T> matcher) {
    checkNotNull(matcher);
    if (!matcher.matches(actual)) {
      String format = "expecting:<%s> to have:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, matcher));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

   * @throws AssertionError if the <em>actual</em> value satisfies the given {@code Matcher}.
   */
  public <T> void assertDoesNotHave(Description description, T actual, Matcher<? super T> matcher) {
    if (matcher.matches(actual)) {
      String format = "expecting:<%s> not to have:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, matcher));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

   */
  public void assertEqualsIgnoringCase(@Nullable Description description, @Nullable String actual,
      @Nullable String expected) {
    if (!areEqualIgnoringCase(actual, expected)) {
      String format = "expecting:<%s> to be equal to:<%s>, ignoring case considerations";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, expected));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

  public void assertContains(@Nullable Description description, @Nullable String actual, @Nonnull String sequence) {
    checkNotNull(sequence);
    assertNotNull(description, actual);
    if (!actual.contains(sequence)) {
      String format = "expecting:<%s> to contain:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, sequence));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

      @Nonnull String sequence) {
    checkNotNull(sequence);
    assertNotNull(description, actual);
    if (actual.contains(sequence)) {
      String format = "expecting:<%s> not to contain:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, sequence));
    }
  }
View Full Code Here

Examples of org.fest.assertions.error.BasicErrorMessageFactory

  public void assertMatches(@Nullable Description description, @Nullable String actual, @Nonnull Pattern pattern) {
    checkNotNull(pattern);
    assertNotNull(description, actual);
    if (!pattern.matcher(actual).matches()) {
      String format = "expecting:<%s> to match regular expression:<%s>";
      throw failures.failure(description, new BasicErrorMessageFactory(format, actual, pattern.pattern()));
    }
  }
View Full Code Here
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.