use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class Iterables_assertAre_Test method should_fail_if_condition_is_not_met.
@Test
public void should_fail_if_condition_is_not_met() {
testCondition.shouldMatch(false);
AssertionInfo info = someInfo();
try {
actual = newArrayList("Yoda", "Luke", "Leia");
iterables.assertAre(someInfo(), actual, jedi);
} catch (AssertionError e) {
verify(conditions).assertIsNotNull(jedi);
verify(failures).failure(info, elementsShouldBe(actual, newArrayList("Leia"), jedi));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertDoesNotContain_Test method should_fail_if_actual_contains_given_values.
@Test
public void should_fail_if_actual_contains_given_values() {
AssertionInfo info = someInfo();
int[] expected = { 6, 8, 20 };
try {
arrays.assertDoesNotContain(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContain(actual, expected, newLinkedHashSet(6, 8)));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_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();
actual = arrayOf(6, -8, 6, 8);
try {
arraysWithCustomComparisonStrategy.assertDoesNotHaveDuplicates(info, actual);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotHaveDuplicates(actual, newLinkedHashSet(6, 8), absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertEndsWith_Test method should_fail_if_sequence_is_bigger_than_actual.
@Test
public void should_fail_if_sequence_is_bigger_than_actual() {
AssertionInfo info = someInfo();
int[] sequence = { 6, 8, 10, 12, 20, 22 };
try {
arrays.assertEndsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldEndWith(actual, sequence));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.api.AssertionInfo in project assertj-core by joel-costigliola.
the class IntArrays_assertEndsWith_Test method should_fail_if_sequence_is_bigger_than_actual_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_sequence_is_bigger_than_actual_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
int[] sequence = { 6, -8, 10, 12, 20, 22 };
try {
arraysWithCustomComparisonStrategy.assertEndsWith(info, actual, sequence);
} catch (AssertionError e) {
verify(failures).failure(info, shouldEndWith(actual, sequence, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations