This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StringsValueParameterizedTestDemo { | |
private Person person1; | |
private Person person2; | |
@BeforeEach | |
void beforeEach() { | |
person1 = new Person("Ryosuke", "Uchitate", 27, Gender.MAN); | |
person2 = new Person("Taro", "Uchitate", 20, Gender.MAN); | |
} | |
/** | |
* Value Source | |
*/ | |
@ParameterizedTest | |
@ValueSource(strings = {"Ryosuke Uchitate", "Taro Uchitate"}) | |
void stringsValue(String fullName) { | |
List<String> personFullNameList = Arrays.asList(person1.getFullName(), person2.getFullName()); | |
assertTrue(personFullNameList.contains(fullName)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment