use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class BooleanArrays_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();
boolean value = true;
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 ObjectArrays_assertContains_at_Index_Test method should_fail_if_actual_does_not_contain_value_at_index_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_contain_value_at_index_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
Index index = atIndex(1);
try {
arraysWithCustomComparisonStrategy.assertContains(info, actual, "Han", index);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainAtIndex(actual, "Han", index, "Luke", caseInsensitiveStringComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class ObjectArrays_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, "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 DoubleArrays_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() {
double value = 6;
Index index = atIndex(1);
thrown.expectAssertionError(shouldContainAtIndex(actual, value, index, 8d));
arrays.assertContains(someInfo(), actual, value, index);
}
use of org.assertj.core.data.Index in project assertj-core by joel-costigliola.
the class DoubleArrays_assertContains_at_Index_Test method should_fail_if_actual_does_not_contain_value_at_index_according_to_custom_comparison_strategy.
@Test
public void should_fail_if_actual_does_not_contain_value_at_index_according_to_custom_comparison_strategy() {
double value = 6;
Index index = atIndex(1);
thrown.expectAssertionError(shouldContainAtIndex(actual, value, index, 8d, absValueComparisonStrategy));
arraysWithCustomComparisonStrategy.assertContains(someInfo(), actual, value, index);
}
Aggregations