Replies: 3 comments 5 replies
-
Perhaps |
Beta Was this translation helpful? Give feedback.
-
Duplicates: |
Beta Was this translation helpful? Give feedback.
-
On the face of it, this test just seems badly written. And with garbage in, you get garbage out. The assert throws is overly broad, perhaps because But then it is also throwing an exception for cases where the test doesn't apply. I don't understand why. I guess it is a workaround for the fact that an exception is always expected But then types for which So I think the automatic conversion highlights a bad pattern. And that pattern should be fixed, not accommodated.
To answer the question: because with JUnit you can specify more precisely where an exception should occur. You can abort before you expect that exception. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@lahodaj asked in a different channel
Beta Was this translation helpful? Give feedback.
All reactions