-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add AssertNot* methods #203
Comments
Hey @iadonkey! Is it possible to simply use |
In the end I can boil everything down to AssertFalse or AssertTrue, but I was actually talking about these kind of assertions using AssertTrue or AssertFalse does not give good informations in the assertion message |
Aha, I've missed that. I've only used JUnit 4. |
Yes, without some refactoring this would be a lot of code duplication as well. Also, ofc you can bypass the need for it by using AssertTrue/AssertFalse with the disadvantages of losing the automatic expected and actual output message. Junit5 writes something along those lines The actual use cases I got are
It is not a very important feature, but more or less for the sake of completeness. |
I agree, the AssertNot makes a lot of sense and it's a great idea. Some of the tests I've seen (including my own ones) would be cleaner with an AssertNot. You've made me walk into the path of installing the JDK and playing around a little bit with JUnit 5 to get a little bit of feeling of how it's handled there. |
I realize that JUnit5 manages messages quite differently than TcUnit. If I add a "Message" of "This failed!" to the If I add a "Message" of "This failed!" to the So it seems they simply replace the "Values should be different" with the user-customized message. Have to think of something that makes sense for TcUnit. |
Some unit tests require to assert for the opposite condition, e.g. AssertArray2dNotEquals_LREAL
@sagatowski this would require a lot of duplicated code. If I would implement this, would you suggest to try to avoid code duplication or just go for it? Avoiding duplication would mean a lot of refactoring of the existing code base
The text was updated successfully, but these errors were encountered: