Package org.assertj.core.api

Examples of org.assertj.core.api.AssertionInfo


    bigDecimalsWithComparatorComparisonStrategy.assertNotEqual(someInfo(), TEN, ONE);
  }

  @Test
  public void should_fail_if_big_decimals_are_equal_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();
    try {
      bigDecimalsWithComparatorComparisonStrategy.assertNotEqual(info, ONE_WITH_3_DECIMALS, ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldNotBeEqual(ONE_WITH_3_DECIMALS, ONE, comparatorComparisonStrategy));
      return;
View Full Code Here


    maps.assertHasSameSizeAs(someInfo(), actual, (Map<?, ?>) null);
  }

  @Test
  public void should_fail_if_size_of_actual_is_not_equal_to_size_of_other() {
    AssertionInfo info = someInfo();
    Map<?, ?> other = mapOf(entry("name", "Solo"));
    try {
      maps.assertHasSameSizeAs(info, actual, other);
      failBecauseExpectedAssertionErrorWasNotThrown();
    } catch (AssertionError e) {
      assertThat(e).hasMessage(
          shouldHaveSameSizeAs(actual, actual.size(), other.size()).create(null, info.representation()));
    }
  }
View Full Code Here

    doubles.assertGreaterThanOrEqualTo(someInfo(), 6d, 6d);
  }

  @Test
  public void should_fail_if_actual_is_less_than_other() {
    AssertionInfo info = someInfo();
    try {
      doubles.assertGreaterThanOrEqualTo(info, 6d, 8d);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeGreaterOrEqual(6d, 8d));
      return;
View Full Code Here

    doublesWithAbsValueComparisonStrategy.assertGreaterThanOrEqualTo(someInfo(), -6d, 6d);
  }

  @Test
  public void should_fail_if_actual_is_less_than_other_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();
    try {
      doublesWithAbsValueComparisonStrategy.assertGreaterThanOrEqualTo(info, -6d, 8d);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeGreaterOrEqual(-6d, 8d, absValueComparisonStrategy));
      return;
View Full Code Here

    floats.assertGreaterThanOrEqualTo(someInfo(), 6f, 6f);
  }

  @Test
  public void should_fail_if_actual_is_less_than_other() {
    AssertionInfo info = someInfo();
    try {
      floats.assertGreaterThanOrEqualTo(info, 6f, 8f);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeGreaterOrEqual(6f, 8f));
      return;
View Full Code Here

    floatsWithAbsValueComparisonStrategy.assertGreaterThanOrEqualTo(someInfo(), 6f, 6f);
  }

  @Test
  public void should_fail_if_actual_is_less_than_other_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();
    try {
      floatsWithAbsValueComparisonStrategy.assertGreaterThanOrEqualTo(info, 6f, -8f);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeGreaterOrEqual(6f, -8f, absValueComparisonStrategy));
      return;
View Full Code Here

    maps.assertContainsKeys(someInfo(), actual, (String) null);
  }

  @Test
  public void should_fail_if_actual_does_not_contain_key() {
    AssertionInfo info = someInfo();
    String key = "power";
    try {
      maps.assertContainsKeys(info, actual, key);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldContainKeys(actual, newLinkedHashSet(key)));
View Full Code Here

  bigDecimals.assertLessThanOrEqualTo(someInfo(), ONE, new BigDecimal("1.00"));
 
  @Test
  public void should_fail_if_actual_is_less_than_other() {
    AssertionInfo info = someInfo();
    try {
      bigDecimals.assertLessThanOrEqualTo(info, TEN, ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeLessOrEqual(TEN, ONE));
      return;
View Full Code Here

    bigDecimalsWithAbsValueComparisonStrategy.assertLessThanOrEqualTo(someInfo(), ONE.negate(), ONE);
  }

  @Test
  public void should_fail_if_actual_is_less_than_other_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();
    try {
      bigDecimalsWithAbsValueComparisonStrategy.assertLessThanOrEqualTo(info, TEN.negate(), ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeLessOrEqual(TEN.negate(), ONE, absValueComparisonStrategy));
      return;
View Full Code Here

    doubles.assertLessThanOrEqualTo(someInfo(), 6d, 6d);
  }

  @Test
  public void should_fail_if_actual_is_greater_than_other() {
    AssertionInfo info = someInfo();
    try {
      doubles.assertLessThanOrEqualTo(info, 8d, 6d);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeLessOrEqual(8d, 6d));
      return;
View Full Code Here

TOP

Related Classes of org.assertj.core.api.AssertionInfo

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.