Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support object field access for ParameterizedTest's name #2572

Closed
Phlegethonyarre opened this issue Mar 17, 2021 · 1 comment
Closed

Support object field access for ParameterizedTest's name #2572

Phlegethonyarre opened this issue Mar 17, 2021 · 1 comment

Comments

@Phlegethonyarre
Copy link

@ParameterizedTest(name = "...") provides feature to get it's argument value into it's name by using '{0}'.

The common use is that i want to use an Object within an argument (for example User).
In this case i have to go with providing another string argument into test source, that looks like
@ParameterizedTest(name = "I am testing user with name {0}")
void testUser(String userName, User user) {
...
}

But what people need is provide only User argument and access needed field through name (user.getName() or user.name):
@ParameterizedTest(name = "I am testing user with name user.name")
void testUser(User user) {
...
}

Please allow us to do this <3

@sbrannen
Copy link
Member

Closing as a duplicate of #1154.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants