12345678910111213141516171819202122232425262728293031323334353637383940 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class DateTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class DateTest
- {
- Date test;
- Date d;
- @Test
- public void toStringTest() {
- try{test = new Date(8,2,1985);}
- catch(DateException de){};
-
-
- String expected = "8/2/1985";
- String actual = test.toString();
- assertEquals(expected,actual);
- }
-
- @Test
- public void lessThanTest(){
- try{test = new Date(8,2,1985);}
- catch(DateException de){};
-
- try{d = new Date(9,2,1985);}
- catch(DateException de){};
-
- assertTrue(test.lessThan(d));
- }
- }
|