use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_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();
int[] expected = { 6, -8, 20 };
try {
arraysWithCustomComparisonStrategy.assertContainsExactly(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainExactly(actual, asList(expected), newArrayList(20), newArrayList(10), absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertContainsOnlyOnce_Test method should_fail_if_actual_contains_given_values_only_more_than_once.
@Test
public void should_fail_if_actual_contains_given_values_only_more_than_once() {
AssertionInfo info = someInfo();
actual = arrayOf(6, -8, 10, -6, -8, 10, -8, 6);
int[] expected = { 6, -8, 20 };
try {
arrays.assertContainsOnlyOnce(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainsOnlyOnce(actual, expected, newLinkedHashSet(20), newLinkedHashSet(6, -8)));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertContainsOnlyOnce_Test method should_fail_if_actual_contains_given_values_only_more_than_once_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_given_values_only_more_than_once_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
actual = arrayOf(6, -8, 10, -6, -8, 10, -8);
int[] expected = { 6, -8, 20 };
try {
arraysWithCustomComparisonStrategy.assertContainsOnlyOnce(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainsOnlyOnce(actual, expected, newLinkedHashSet(20), newLinkedHashSet(6, -8), absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertContainsSequence_Test method should_fail_if_actual_contains_first_elements_of_sequence_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_first_elements_of_sequence_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
int[] sequence = { 6, 20, 22 };
try {
arraysWithCustomComparisonStrategy.assertContainsSequence(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainSequence(actual, sequence, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertContainsSequence_Test method should_fail_if_actual_contains_first_elements_of_sequence.
@Test
public void should_fail_if_actual_contains_first_elements_of_sequence() {
AssertionInfo info = someInfo();
int[] sequence = { 6, 20, 22 };
try {
arrays.assertContainsSequence(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainSequence(actual, sequence));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations