use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertIsNotCloseTo_Test method should_fail_if_actual_is_too_close_to_the_other_value_with_strict_offset.
@Test
@DataProvider({ "1, 2, 10", "1, 0, 2", "0, 1, 2" })
public void should_fail_if_actual_is_too_close_to_the_other_value_with_strict_offset(int actual, int other, int offset) {
AssertionInfo info = someInfo();
try {
integers.assertIsNotCloseTo(info, actual, other, byLessThan(offset));
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotBeEqual(actual, other, byLessThan(offset), abs(actual - other)));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertIsStrictlyBetween_Test method should_fail_if_actual_is_equal_to_range_end.
@Test
public void should_fail_if_actual_is_equal_to_range_end() {
AssertionInfo info = someInfo();
try {
integers.assertIsStrictlyBetween(info, ONE, ZERO, ONE);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeBetween(ONE, ZERO, ONE, false, false));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertLessThan_Test method should_fail_if_actual_is_equal_to_other_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_is_equal_to_other_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
try {
integersWithAbsValueComparisonStrategy.assertLessThan(info, 6, -6);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(6, -6, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertLessThan_Test method should_fail_if_actual_is_equal_to_other.
@Test
public void should_fail_if_actual_is_equal_to_other() {
AssertionInfo info = someInfo();
try {
integers.assertLessThan(info, 6, 6);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(6, 6));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertLessThan_Test method should_fail_if_actual_is_greater_than_other_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_is_greater_than_other_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
try {
integersWithAbsValueComparisonStrategy.assertLessThan(info, -8, 6);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(-8, 6, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations