Saturday, 14 September 2013

Unit tests with java

Unit tests with java

I'm working on test cases in java.
I have a code something like this:
class Sample
{
public boolean isALive(boolean isLive, int num)
{
return if isLive ? num == 3 : num == 2 || num == 3;
}
}
In the tests, it will be something like this,
assertTrue(x.isAlive(true,1); with various combinations
Is there way to simplify or optimize this even more for all the tests to
pass ?

No comments:

Post a Comment