Skip to content

Instantly share code, notes, and snippets.

@b1a9id
Last active January 17, 2018 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b1a9id/c37b9f1280c9415cdd69233bdcb1e3f6 to your computer and use it in GitHub Desktop.
Save b1a9id/c37b9f1280c9415cdd69233bdcb1e3f6 to your computer and use it in GitHub Desktop.
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