> I have a class with an assert keyword.
> Now, when an assert fails, the test is marked as "not passed".
> There is a manner to test that the assert fail (I mean in a "positive"
> way, like with the try catch for the exception).
Two options:
1. Assert the logical opposite -- instead of assert x, use assert !x.
2. Use the standard pattern for expecting an exception for the error
class AssertionError. (See c2.com/cgi/wiki?CodingJavaUnitExceptionTests)
--
J. B. (Joe) Rainsberger
Diaspar Software Services
http://www.diasparsoftware.com
Author, JUnit Recipes: Practical Methods for Programmer Testing
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
