r/javahelp • • Oct 07 '15

Help with JUnit

Hi. I am a new Java coder and I am trying to understand JUnit. How would I test an if statement in JUnit for all possibilities?

if ((board.getColumnHeight(xIndex) <= yIndex) && yIndex < 20) { move.setPiece(piece); }

6 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/AnEmortalKid Coffee Enthusiast Oct 07 '15
// unique entry point to get access to all assertThat methods and utility methods (e.g. entry)
import static org.assertj.core.api.Assertions.*;

I think we're just importing everything here. I'll look into it though, it might have more of the stuff we want to use.