How to write testng testcase for private final anonymous class

33 Views Asked by At
private final SampleFormatter sampleFormatter = new SampleFormatter() {

    @Override
    public String formatDouble (int tag, double Value, int pre) { 
        if (Double.isNaN(Value)) {
            return "NaN";
        } 
        if (Value == 0.0D) {
            return "0";
        } else {
            return df.format(Value);
        }
    }

}

Here sample formatter is an interface and its method is implemented here.

How to get coverage for this format Double() method by writing testng test case.

0

There are 0 best solutions below