-
Why are test methods restricted to the void type? If they could return a value, it seems like it would provide more flexibility. The framework could simply ignore the return value, and developers could use test methods not only for testing purposes but also for other business logic if needed. |
Beta Was this translation helpful? Give feedback.
Answered by
sbrannen
May 22, 2025
Replies: 1 comment 1 reply
-
The rationale is that it is likely an error if a For background see: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sormuras
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The rationale is that it is likely an error if a
@Test
method returns something, since the testing framework will never make use of such a return value.For background see: