use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_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 {
floatsWithAbsValueComparisonStrategy.assertLessThan(info, -8f, 6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(-8f, 6f, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_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 {
floats.assertLessThan(info, 6f, 6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(6f, 6f));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_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 {
floatsWithAbsValueComparisonStrategy.assertLessThan(info, 6f, -6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeLess(6f, -6f, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertNotEqual_Test method should_fail_if_floats_are_equal.
@Test
public void should_fail_if_floats_are_equal() {
AssertionInfo info = someInfo();
try {
floats.assertNotEqual(info, 6f, 6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotBeEqual(6f, 6f));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Floats_assertNotEqual_Test method should_fail_if_floats_are_equal_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_floats_are_equal_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
try {
floatsWithAbsValueComparisonStrategy.assertNotEqual(info, 6f, -6f);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotBeEqual(6f, -6f, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations