use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsAnyOf_Test method should_fail_if_actual_does_not_contain_any_of_the_given_values.
@Test
public void should_fail_if_actual_does_not_contain_any_of_the_given_values() {
AssertionInfo info = someInfo();
Object[] expected = { "Han", "John" };
try {
iterables.assertContainsAnyOf(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainAnyOf(actual, expected));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactlyInAnyOrder_Test method should_fail_if_actual_does_not_contain_given_values_exactly_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_contain_given_values_exactly_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] expected = { "Luke", "Yoda", "Han" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertContainsExactlyInAnyOrder(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactlyInAnyOrder(actual, expected, newArrayList("Han"), newArrayList("Leia"), comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactlyInAnyOrder_Test method should_pass_if_actual_contains_all_given_values_in_different_order.
@Test
public void should_pass_if_actual_contains_all_given_values_in_different_order() {
AssertionInfo info = someInfo();
Object[] expected = { "Luke", "Leia", "Yoda" };
iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactlyInAnyOrder_Test method should_fail_if_actual_contains_duplicates_and_expected_does_not.
@Test
public void should_fail_if_actual_contains_duplicates_and_expected_does_not() {
AssertionInfo info = someInfo();
actual = newArrayList("Luke", "Leia", "Luke");
Object[] expected = { "Luke", "Leia" };
try {
iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactlyInAnyOrder(actual, expected, emptyList(), newArrayList("Luke"), StandardComparisonStrategy.instance()));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactlyInAnyOrder_Test method should_fail_if_actual_does_not_contain_given_values_exactly.
@Test
public void should_fail_if_actual_does_not_contain_given_values_exactly() {
AssertionInfo info = someInfo();
Object[] expected = { "Luke", "Yoda", "Han" };
try {
iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactlyInAnyOrder(actual, expected, newArrayList("Han"), newArrayList("Leia"), StandardComparisonStrategy.instance()));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations