use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertGreaterThan_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 {
floats.assertGreaterThan(info, 6f, 6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeGreater(6f, 6f));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertGreaterThan_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 {
floatsWithAbsValueComparisonStrategy.assertGreaterThan(info, -6f, 6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeGreater(-6f, 6f, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertIsCloseToPercentage_Test method should_fail_if_actual_is_not_close_enough_to_expected_value.
@Test
public void should_fail_if_actual_is_not_close_enough_to_expected_value() {
AssertionInfo info = someInfo();
try {
floats.assertIsCloseToPercentage(someInfo(), ONE, TEN, withPercentage(TEN));
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeEqualWithinPercentage(ONE, TEN, withinPercentage(10), TEN - ONE));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertIsCloseTo_Test method should_fail_if_actual_is_not_close_enough_to_expected_value.
@Test
public void should_fail_if_actual_is_not_close_enough_to_expected_value() {
AssertionInfo info = someInfo();
try {
floats.assertIsCloseTo(info, ONE, TEN, within(ONE));
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeEqual(ONE, TEN, within(ONE), TEN - ONE));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertIsCloseTo_Test method should_fail_if_actual_is_not_close_enough_to_expected_value_whatever_custom_comparison_strategy_is.
@Test
public void should_fail_if_actual_is_not_close_enough_to_expected_value_whatever_custom_comparison_strategy_is() {
AssertionInfo info = someInfo();
try {
floatsWithAbsValueComparisonStrategy.assertIsCloseTo(info, new Float(6f), new Float(8f), offset(1f));
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeEqual(6f, 8f, offset(1f), 2f));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations