use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertStartsWith_Test method should_fail_if_sequence_is_bigger_than_actual_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_sequence_is_bigger_than_actual_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
int[] sequence = { 6, -8, 10, 12, 20, 22 };
try {
arraysWithCustomComparisonStrategy.assertStartsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldStartWith(actual, sequence, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertStartsWith_Test method should_fail_if_actual_does_not_start_with_sequence_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_start_with_sequence_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
int[] sequence = { -8, 10 };
try {
arraysWithCustomComparisonStrategy.assertStartsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldStartWith(actual, sequence, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertStartsWith_Test method should_fail_if_actual_starts_with_first_elements_of_sequence_only.
@Test
public void should_fail_if_actual_starts_with_first_elements_of_sequence_only() {
AssertionInfo info = someInfo();
int[] sequence = { 6, 20 };
try {
arrays.assertStartsWith(info, actual, sequence);
} catch (AssertionError e) {
verifyFailureThrownWhenSequenceNotFound(info, sequence);
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertEqual_Test method should_fail_if_integers_are_not_equal.
@Test
public void should_fail_if_integers_are_not_equal() {
AssertionInfo info = someInfo();
try {
integers.assertEqual(info, 6, 8);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeEqual(6, 8, info.representation()));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Integers_assertGreaterThanOrEqualTo_Test method should_fail_if_actual_is_less_than_other.
@Test
public void should_fail_if_actual_is_less_than_other() {
AssertionInfo info = someInfo();
try {
integers.assertGreaterThanOrEqualTo(info, 6, 8);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeGreaterOrEqual(6, 8));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations