Johnny Van :
this is my class i want to test if the 0<= amount <25000 then theres no tax. but it doesn't work. the test fails.
public class TaxCalculator{
public double calc(double amount){
double pay = amount*0;
return pay;
}
}
my test looks like this. i've imported both Test and Assert.
public class TaxCalculatorTest{
@Test
public void testCalc(){
assertEquals(0,tax.calc(1));
Bor Laze :
assertEquals(double expected, double actual)
is deprecated and ALWAYS fails.
use assertEquals(double expected, double actual, double delta)
instead