1 37 package net.sourceforge.cruisecontrol.util; 38 39 import java.text.NumberFormat ; 40 41 import junit.framework.TestCase; 42 43 47 public class TimeNumberFormatTest extends TestCase { 48 private NumberFormat test; 49 50 protected void setUp() { 51 test = new TimeNumberFormat(); 52 } 53 54 public void testMidnight() { 55 assertEquals("00:00", test.format(0)); 56 } 57 58 public void testOneMinutePastMidnight() { 59 assertEquals("00:01", test.format(60 * 1000)); 60 } 61 62 public void testOneInTheAfternoon() { 63 assertEquals("13:00", test.format(13 * 60 * 60 * 1000)); 64 } 65 66 public void testOneInTheMorningTheNextDay() { 67 assertEquals("01:00", test.format(25 * 60 * 60 * 1000)); 68 } 69 } 70 | Popular Tags |