I can write an assertion message one of two ways. Stating success:
assertEquals( "objects should be identical", expected, actual );
Or stating the condition of being broken:
assertEquals( "objects aren't identical", expected, actual );
Is there a standard for this in JUnit specifically? If not, what are the arguments for each side?
P.S. I've seen articles on the web demonstrating both of these without explanation, so just saying "search Google" is not an answer!
[UPDATE]
Everyone is getting hung up on the fact that I used assertEquals
and therefore the message is probably useless. But of course that's just because I wanted to illustrate the question simply.
So imagine instead it's:
assertTrue( ... big long multi-line expression ... );
Where a message is useful.