How to use valuesToLookForIsEmpty method of org.assertj.core.internal.ErrorMessages class

Best Assertj code snippet using org.assertj.core.internal.ErrorMessages.valuesToLookForIsEmpty

Source:CharArrays_assertDoesNotContain_Test.java Github

copy

Full Screen

...16import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;17import static org.assertj.core.api.Assertions.assertThatNullPointerException;18import static org.assertj.core.api.Assertions.catchThrowable;19import static org.assertj.core.error.ShouldNotContain.shouldNotContain;20import static org.assertj.core.internal.ErrorMessages.valuesToLookForIsEmpty;21import static org.assertj.core.internal.ErrorMessages.valuesToLookForIsNull;22import static org.assertj.core.test.CharArrays.arrayOf;23import static org.assertj.core.test.CharArrays.emptyArray;24import static org.assertj.core.test.TestData.someInfo;25import static org.assertj.core.util.FailureMessages.actualIsNull;26import static org.assertj.core.util.Sets.newLinkedHashSet;27import static org.mockito.Mockito.verify;28import org.assertj.core.api.AssertionInfo;29import org.assertj.core.internal.CharArrays;30import org.assertj.core.internal.CharArraysBaseTest;31import org.junit.jupiter.api.Test;32/**33 * Tests for <code>{@link CharArrays#assertDoesNotContain(AssertionInfo, char[], char[])}</code>.34 * 35 * @author Alex Ruiz36 * @author Joel Costigliola37 */38class CharArrays_assertDoesNotContain_Test extends CharArraysBaseTest {39 @Test40 void should_pass_if_actual_does_not_contain_given_values() {41 arrays.assertDoesNotContain(someInfo(), actual, arrayOf('d'));42 }43 @Test44 void should_pass_if_actual_does_not_contain_given_values_even_if_duplicated() {45 arrays.assertDoesNotContain(someInfo(), actual, arrayOf('d', 'd', 'e'));46 }47 @Test48 void should_throw_error_if_array_of_values_to_look_for_is_empty() {49 assertThatIllegalArgumentException().isThrownBy(() -> arrays.assertDoesNotContain(someInfo(), actual, emptyArray()))50 .withMessage(valuesToLookForIsEmpty());51 }52 @Test53 void should_throw_error_if_array_of_values_to_look_for_is_null() {54 assertThatNullPointerException().isThrownBy(() -> arrays.assertDoesNotContain(someInfo(), actual, null))55 .withMessage(valuesToLookForIsNull());56 }57 @Test58 void should_fail_if_actual_is_null() {59 assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> arrays.assertDoesNotContain(someInfo(), null, arrayOf('a')))60 .withMessage(actualIsNull());61 }62 @Test63 void should_fail_if_actual_contains_given_values() {64 AssertionInfo info = someInfo();65 char[] expected = { 'a', 'b', 'd' };66 Throwable error = catchThrowable(() -> arrays.assertDoesNotContain(info, actual, expected));67 assertThat(error).isInstanceOf(AssertionError.class);68 verify(failures).failure(info, shouldNotContain(actual, expected, newLinkedHashSet('a', 'b')));69 }70 @Test71 void should_pass_if_actual_does_not_contain_given_values_according_to_custom_comparison_strategy() {72 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, arrayOf('d'));73 }74 @Test75 void should_pass_if_actual_does_not_contain_given_values_even_if_duplicated_according_to_custom_comparison_strategy() {76 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, arrayOf('d', 'd', 'e'));77 }78 @Test79 void should_throw_error_if_array_of_values_to_look_for_is_empty_whatever_custom_comparison_strategy_is() {80 assertThatIllegalArgumentException().isThrownBy(() -> arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(),81 actual,82 emptyArray()))83 .withMessage(valuesToLookForIsEmpty());84 }85 @Test86 void should_throw_error_if_array_of_values_to_look_for_is_null_whatever_custom_comparison_strategy_is() {87 assertThatNullPointerException().isThrownBy(() -> arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(),88 actual,89 null))90 .withMessage(valuesToLookForIsNull());91 }92 @Test93 void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {94 assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), null, arrayOf('A')))95 .withMessage(actualIsNull());96 }97 @Test...

Full Screen

Full Screen

Source:DoubleArrays_assertDoesNotContain_Test.java Github

copy

Full Screen

...11 * Copyright 2012-2018 the original author or authors.12 */13package org.assertj.core.internal.doublearrays;14import static org.assertj.core.error.ShouldNotContain.shouldNotContain;15import static org.assertj.core.internal.ErrorMessages.valuesToLookForIsEmpty;16import static org.assertj.core.internal.ErrorMessages.valuesToLookForIsNull;17import static org.assertj.core.test.DoubleArrays.arrayOf;18import static org.assertj.core.test.DoubleArrays.emptyArray;19import static org.assertj.core.test.TestData.someInfo;20import static org.assertj.core.util.FailureMessages.actualIsNull;21import static org.assertj.core.util.Sets.newLinkedHashSet;22import org.assertj.core.api.AssertionInfo;23import org.assertj.core.internal.DoubleArrays;24import org.assertj.core.internal.DoubleArraysBaseTest;25import org.junit.Test;26/**27 * Tests for <code>{@link DoubleArrays#assertDoesNotContain(AssertionInfo, double[], double[])}</code>.28 * 29 * @author Alex Ruiz30 * @author Joel Costigliola31 */32public class DoubleArrays_assertDoesNotContain_Test extends DoubleArraysBaseTest {33 @Override34 protected void initActualArray() {35 actual = arrayOf(6d, 8d, 10d);36 }37 @Test38 public void should_pass_if_actual_does_not_contain_given_values() {39 arrays.assertDoesNotContain(someInfo(), actual, arrayOf(12d));40 }41 @Test42 public void should_pass_if_actual_does_not_contain_given_values_even_if_duplicated() {43 arrays.assertDoesNotContain(someInfo(), actual, arrayOf(12d, 12d, 20d));44 }45 @Test46 public void should_throw_error_if_array_of_values_to_look_for_is_empty() {47 thrown.expectIllegalArgumentException(valuesToLookForIsEmpty());48 arrays.assertDoesNotContain(someInfo(), actual, emptyArray());49 }50 @Test51 public void should_throw_error_if_array_of_values_to_look_for_is_null() {52 thrown.expectNullPointerException(valuesToLookForIsNull());53 arrays.assertDoesNotContain(someInfo(), actual, null);54 }55 @Test56 public void should_fail_if_actual_is_null() {57 thrown.expectAssertionError(actualIsNull());58 arrays.assertDoesNotContain(someInfo(), null, arrayOf(8d));59 }60 @Test61 public void should_fail_if_actual_contains_given_values() {62 double[] expected = { 6d, 8d, 20d };63 thrown.expectAssertionError(shouldNotContain(actual, expected, newLinkedHashSet(6d, 8d)));64 arrays.assertDoesNotContain(someInfo(), actual, expected);65 }66 @Test67 public void should_pass_if_actual_does_not_contain_given_values_according_to_custom_comparison_strategy() {68 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, arrayOf(12d));69 }70 @Test71 public void should_pass_if_actual_does_not_contain_given_values_even_if_duplicated_according_to_custom_comparison_strategy() {72 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, arrayOf(12d, 12d, 20d));73 }74 @Test75 public void should_throw_error_if_array_of_values_to_look_for_is_empty_whatever_custom_comparison_strategy_is() {76 thrown.expectIllegalArgumentException(valuesToLookForIsEmpty());77 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, emptyArray());78 }79 @Test80 public void should_throw_error_if_array_of_values_to_look_for_is_null_whatever_custom_comparison_strategy_is() {81 thrown.expectNullPointerException(valuesToLookForIsNull());82 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), actual, null);83 }84 @Test85 public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {86 thrown.expectAssertionError(actualIsNull());87 arraysWithCustomComparisonStrategy.assertDoesNotContain(someInfo(), null, arrayOf(-8d));88 }89 @Test90 public void should_fail_if_actual_contains_given_values_according_to_custom_comparison_strategy() {...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful