public class CalculatorTest extends TestCase
{
Calculator calc = new Calculator();
public void testAdd()
{
int a = 3;
if(a==3)
fail("Faieled as a is 3");
}
}
Hi
when i execute this , the Testcase is failed under Junit .
Basically what i want is when this condition (a==3) matches (true ) then
the method should fail and junit should show pass result ( Green color , in eclipse )
have you tried replacing
fail("Failed as is 3");withassertTrue(true);That should give you a pass.