Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MethodSourceMultiArgsParameterizedTest{
@ParameterizedTest
@MethodSource("multiArgumentsProvider")
void multiArguments(String name, int age, Gender gender) {
assertFalse(name.length() > 100);
assertTrue( age > 0 && age < 30);
assertTrue(gender.name().length() > 1);
}
static Stream<Arguments> multiArgumentsProvider() {
return Stream.of(
Arguments.of("Ryosuke", 27, Gender.MAN),
Arguments.of("Hanako", 20, Gender.WOMAN)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment