use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertEndsWithFirstAndRest_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();
Object[] sequence = { "Han", "C-3PO" };
try {
iterables.assertEndsWith(info, actual, "Obi-Wan", sequence);
} catch (AssertionError e) {
verifyFailureThrownWhenSequenceNotFound(info, "Obi-Wan", sequence);
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_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();
Object[] sequence = { "Han", "C-3PO" };
try {
iterables.assertEndsWith(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 Iterables_assertEndsWith_Test method should_fail_if_sequence_is_bigger_than_actual.
@Test
public void should_fail_if_sequence_is_bigger_than_actual() {
AssertionInfo info = someInfo();
Object[] sequence = { "Yoda", "Luke", "Leia", "Obi-Wan", "Han", "C-3PO", "R2-D2", "Anakin" };
try {
iterables.assertEndsWith(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 Iterables_assertEndsWith_Test method should_fail_if_actual_does_not_end_with_sequence_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_end_with_sequence_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] sequence = { "Han", "C-3PO" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertEndsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldEndWith(actual, sequence, comparisonStrategy));
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_sequence_is_bigger_than_actual.
@Test
public void should_fail_if_sequence_is_bigger_than_actual() {
AssertionInfo info = someInfo();
int[] sequence = { 6, 8, 10, 12, 20, 22 };
try {
arrays.assertStartsWith(info, actual, sequence);
} catch (AssertionError e) {
verifyFailureThrownWhenSequenceNotFound(info, sequence);
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations