Hello,
I check the code with a unittest. In the unittest i see two errors.
Can someone help me to fix the errors?
thanks in advance
the class is:
[CODE]public class Time implements ITime {
private GregorianCalendar gc;
@Override
public int compareTo(ITime t) {
Time time = (Time) t;
return time.gc.compareTo(gc);//this is error 1
//return time.compareTo(t);
}
}
the classTest.java
[CODE]public class TimeTest {
@Test
public void testCompareTo() {
System.out.println(“compareTo”);
ITime t = null;
//Time instance = null;
int expResult = 0;
int result = instance.compareTo(t);//this is error 2
//assertEquals(expResult, result);
assertEquals(“comparable”, 0, instance.compareTo(t));
// TODO review the generated test code and remove the default call to fail.
// fail(“The test case is a prototype.”);
}
}