Reputation: 35
I'm new to JUnit testing. I've tried using conditions, but it doesn't seem to work using assertEquals. For example, assertEquals(1 > 0, 10) which gives me a failed test. Is there another way of doing it? Thanks.
Upvotes: 1
Views: 1800
Reputation: 1490
Use assertTrue, in your case: assertTrue(x > 0).
You can find all provided assertion-types here.
Upvotes: 4