use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertEndsWith_Test method should_fail_if_actual_does_not_end_with_sequence.
@Test
public void should_fail_if_actual_does_not_end_with_sequence() {
AssertionInfo info = someInfo();
int[] sequence = { 20, 22 };
try {
arrays.assertEndsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldEndWith(actual, sequence));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertHasSameSizeAs_with_Array_Test method should_fail_if_size_of_actual_is_not_equal_to_expected_size.
@Test
public void should_fail_if_size_of_actual_is_not_equal_to_expected_size() {
AssertionInfo info = someInfo();
String[] other = array("Solo", "Leia", "Yoda", "Luke");
thrown.expectAssertionError(shouldHaveSameSizeAs(actual, actual.length, other.length).create(null, info.representation()));
arrays.assertHasSameSizeAs(info, actual, other);
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertIsSorted_Test method should_fail_if_actual_is_not_sorted_in_ascending_order.
@Test
public void should_fail_if_actual_is_not_sorted_in_ascending_order() {
AssertionInfo info = someInfo();
actual = arrayOf(1, 3, 2);
try {
arrays.assertIsSorted(info, actual);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeSorted(1, actual));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertIsSorted_Test method should_fail_if_actual_is_not_sorted_in_ascending_order_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_is_not_sorted_in_ascending_order_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
actual = arrayOf(1, 3, 2);
try {
arraysWithCustomComparisonStrategy.assertIsSorted(info, actual);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeSortedAccordingToGivenComparator(1, actual, comparatorForCustomComparisonStrategy()));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertNotEmpty_Test method should_fail_if_actual_is_empty.
@Test
public void should_fail_if_actual_is_empty() {
AssertionInfo info = someInfo();
try {
arrays.assertNotEmpty(info, emptyArray());
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotBeEmpty());
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations