use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContains_Test method should_fail_if_actual_does_not_contain_values_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_contain_values_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] expected = { "Han", "Luke" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertContains(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContain(actual, expected, newLinkedHashSet("Han"), comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContainAnyElementsOf_Test method should_fail_if_actual_contains_one_element_of_given_iterable_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_one_element_of_given_iterable_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
List<String> expected = newArrayList("LuKe", "YODA", "Han");
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertDoesNotContainAnyElementsOf(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContain(actual, expected.toArray(), newLinkedHashSet("LuKe", "YODA"), comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContainAnyElementsOf_Test method should_fail_if_actual_contains_one_element_of_given_iterable.
@Test
public void should_fail_if_actual_contains_one_element_of_given_iterable() {
AssertionInfo info = someInfo();
List<String> list = newArrayList("Vador", "Yoda", "Han");
try {
iterables.assertDoesNotContainAnyElementsOf(info, actual, list);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContain(actual, list.toArray(), newLinkedHashSet("Yoda")));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertDoesNotContainSequence_Test method should_pass_if_actual_contains_first_elements_of_sequence_but_not_whole_sequence_according_to_custom_comparison_strategy.
@Test
public void should_pass_if_actual_contains_first_elements_of_sequence_but_not_whole_sequence_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] sequence = { "Luke", "Leia", "Han" };
iterablesWithCaseInsensitiveComparisonStrategy.assertDoesNotContainSequence(info, actual, sequence);
}
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_that_specifies_multiple_times_the_same_value.
@Test
public void should_fail_if_actual_contains_sequence_that_specifies_multiple_times_the_same_value() {
AssertionInfo info = someInfo();
actual = newArrayList("a", "-", "b", "-", "c");
Object[] sequence = { "a", "-", "b", "-", "c" };
try {
iterables.assertDoesNotContainSequence(info, actual, sequence);
} catch (AssertionError e) {
verifyFailureThrownWhenSequenceNotFound(info, sequence, 0);
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations