-
Notifications
You must be signed in to change notification settings - Fork 2
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
Parameterized test silently fails when arguments are incorrectly defined #91
Comments
Oh definitely! I'd love this to be an error, before executing the test - just like with customised fields that don't exist. |
Oh boy, that's a tricky one. The problem is, that any annotation-method can only ever have a primitive type (including In your test, when injecting the first argument, it will reflect the type (String) and execute the The only hook on validation that I can see right now, would be finding out which arguments are actually configured in |
Duplicate customisations for the same argument will throw an exception. Refs: #91
I opened a PR for a fix. However I'm not sure, the error message is clearly describing the problem:
Any ideas for improvements? |
Maybe. When I change the test above to
it will still fail with the PR as it is. I don't know how you can catch that when just validating the annotation. If you move the check to where you actually supply the values to the test parameters, this will probably work. |
Good idea, I'll check this out. |
This required to move validation from constructor to getter. Refs: #91
Duplicate customisations for the same argument will throw an exception. Refs: #91
I completely screwed the rebase, so I re-created the branch and opened another PR. |
Duplicate customisations for the same argument will throw an exception. Refs: #91
Fixed in version 2.9.7. |
Given the following test
The test fails with
because there is nothing supplied for
boolean val
. The@TestCase
annotation definedstr1
andbool1
while it should have definedstr1
andbool2
, which leads toval
having a default value offalse
.What I would hope for is a message telling me something like 'cannot define first argument as string and boolean at the same time
or
nothing defined for second argumentor anything instead of just ignoring the
bool1`.The docs say that I cannot do it like this (which is good).
What I would like to discuss is if we should catch this mis-definition and tell the user about it instead of relying on the user to figure out what they mis-defined.
The text was updated successfully, but these errors were encountered: