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_all_given_values_but_size_differ_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_all_given_values_but_size_differ_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
actual = newArrayList("Luke", "Leia", "Luke");
Object[] expected = { "LUKE", "Leia" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertContainsExactlyInAnyOrder(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactlyInAnyOrder(actual, expected, emptyList(), newArrayList("Luke"), 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_according_to_custom_comparison_strategy.
@Test
public void should_pass_if_actual_contains_all_given_values_in_different_order_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] expected = { "Luke", "Leia", "Yoda" };
iterablesWithCaseInsensitiveComparisonStrategy.assertContainsExactlyInAnyOrder(info, actual, expected);
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactly_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.assertContainsExactly(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactly(actual, asList(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_assertContainsExactly_Test method should_fail_if_actual_contains_all_given_values_in_different_order_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_all_given_values_in_different_order_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Object[] expected = { "Luke", "Leia", "Yoda" };
try {
iterablesWithCaseInsensitiveComparisonStrategy.assertContainsExactly(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, elementsDifferAtIndex("Yoda", "Leia", 1, comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertContainsExactly_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.assertContainsExactly(info, actual, expected);
} catch (AssertionError e) {
List<String> notFound = newArrayList("Han");
List<String> notExpected = newArrayList("Leia");
verify(failures).failure(info, shouldContainExactly(actual, asList(expected), notFound, notExpected));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations