use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class CharArrays_assertDoesNotContain_at_Index_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 {
arraysWithCustomComparisonStrategy.assertDoesNotContain(info, actual, 'A', index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, 'A', index, caseInsensitiveComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class ShortArrays_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();
short value = 6;
Index index = atIndex(0);
try {
arrays.assertDoesNotContain(info, actual, value, index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, value, index));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class ShortArrays_assertDoesNotContain_at_Index_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();
short value = 6;
Index index = atIndex(0);
try {
arraysWithCustomComparisonStrategy.assertDoesNotContain(info, actual, value, index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldNotContainAtIndex(actual, value, index, absValueComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class ShortArrays_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();
short value = 6;
Index index = atIndex(1);
try {
arrays.assertContains(info, actual, value, index);
} catch (AssertionError e) {
short found = 8;
verify(failures).failure(info, shouldContainAtIndex(actual, value, index, found));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class Index_atIndex_Test method should_create_new_Index.
@Test
public void should_create_new_Index() {
Index index = Index.atIndex(8);
assertThat(index.value).isEqualTo(8);
}
Aggregations