use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class LongArrays_assertDoesNotContain_at_Index_Test method should_fail_if_actual_contains_value_at_index.
@Test
public void should_fail_if_actual_contains_value_at_index() {
AssertionInfo info = someInfo();
Index index = atIndex(0);
try {
arrays.assertDoesNotContain(info, actual, 6L, index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, 6L, index));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class List_assertIs_Test method should_fail_if_actual_does_not_satisfy_condition_at_index.
@Test
public void should_fail_if_actual_does_not_satisfy_condition_at_index() {
condition.shouldMatch(false);
AssertionInfo info = someInfo();
Index index = atIndex(1);
try {
lists.assertIs(info, actual, condition, index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeAtIndex(actual, condition, index, "Luke"));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class Lists_assertDoesNotContain_Test method should_fail_if_actual_contains_value_at_index_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_contains_value_at_index_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Index index = atIndex(0);
try {
listsWithCaseInsensitiveComparisonStrategy.assertDoesNotContain(info, actual, "YODA", index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, "YODA", index, comparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class Lists_assertDoesNotContain_Test method should_fail_if_actual_contains_value_at_index.
@Test
public void should_fail_if_actual_contains_value_at_index() {
AssertionInfo info = someInfo();
Index index = atIndex(0);
try {
lists.assertDoesNotContain(info, actual, "Yoda", index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, "Yoda", index));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class CharArrays_assertContains_at_Index_Test method should_fail_if_actual_does_not_contain_value_at_index.
@Test
public void should_fail_if_actual_does_not_contain_value_at_index() {
AssertionInfo info = someInfo();
Index index = atIndex(1);
try {
arrays.assertContains(info, actual, 'a', index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainAtIndex(actual, 'a', index, 'b'));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations