Package org.assertj.core.api

Examples of org.assertj.core.api.AssertionInfo.representation()


  public void should_fail_if_characters_are_not_equal() {
    AssertionInfo info = someInfo();
    try {
      charactersWithCaseInsensitiveComparisonStrategy.assertEqual(info, 'b', 'a');
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual('b', 'a', info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here


    String[] other = array("Solo", "Leia", "Yoda", "Luke");
    try {
      arrays.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.length, other.length)
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

  public void should_fail_if_big_decimals_are_not_equal_by_comparison() {
    AssertionInfo info = someInfo();
    try {
      bigDecimals.assertEqualByComparison(info, TEN, ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual(TEN, ONE, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

    List<String> other = newArrayList("Solo", "Leia");
    try {
      strings.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.length(), other.size())
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

    String[] other = array("Solo", "Luke", "Leia");
    try {
      iterables.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.size(), other.length)
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

    String[] other = array("Solo", "Luke", "Leia");
    try {
      iterablesWithCaseInsensitiveComparisonStrategy.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.size(), other.length)
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
}
View Full Code Here

  public void should_fail_if_longs_are_not_equal() {
    AssertionInfo info = someInfo();
    try {
      longs.assertEqual(info, 6L, 8L);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual(6L, 8L, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

    String[] other = array("Solo", "Leia");
    try {
      strings.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.length(), other.length)
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

    AssertionInfo info = someInfo();
    Object actual = new Object();
    try {
      objects.assertNull(info, actual);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual(actual, null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
}
View Full Code Here

    String[] other = array("Solo", "Leia");
    try {
      arrays.assertHasSameSizeAs(info, actual, other);
    } catch (AssertionError e) {
      assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.length, other.length)
          .create(null, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
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.