use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContainSequence_Test method should_fail_if_actual_contains_sequence.
@Test
public void should_fail_if_actual_contains_sequence() {
AssertionInfo info = someInfo();
Object[] sequence = { "Luke", "Leia" };
try {
iterables.assertDoesNotContainSequence(info, actual, sequence);
} catch (AssertionError e) {
verifyFailureThrownWhenSequenceNotFound(info, sequence, 1);
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContainSubsequence_Test method expectFailure.
private void expectFailure(Iterables iterables, Iterable<String> sequence, Object[] subsequence, int index) {
AssertionInfo info = someInfo();
try {
iterables.assertDoesNotContainSubsequence(info, sequence, subsequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainSubsequence(actual, subsequence, iterables.getComparisonStrategy(), index));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContain_Test method should_fail_if_actual_contains_given_values_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_given_values_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] expected = { "LuKe", "YODA", "Han" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertDoesNotContain(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContain(actual, expected, newLinkedHashSet("LuKe", "YODA"), comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotHaveDuplicates_Test method should_fail_if_actual_contains_duplicates_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_duplicates_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Collection<String> duplicates = newLinkedHashSet("LUKE", "yoda");
actual.addAll(duplicates);
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertDoesNotHaveDuplicates(info, actual);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotHaveDuplicates(actual, duplicates, comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertEndsWithFirstAndRest_Test method should_fail_if_actual_ends_with_first_elements_of_sequence_only_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_ends_with_first_elements_of_sequence_only_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] sequence = { "Leia", "Obi-Wan", "Han" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertEndsWith(info, actual, "Luke", sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldEndWith(actual, prepend("Luke", sequence), comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations