FileDocCategorySizeDatePackage
DateUtilsTest.javaAPI DocAndroid 5.1 API2120Thu Mar 12 22:22:12 GMT 2015android.text.format

DateUtilsTest

public class DateUtilsTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtest_formatDuration_Hours()

        assertEquals("59 minutes", DateUtils.formatDuration(3540000));
        assertEquals("1 hour", DateUtils.formatDuration(3600000));
        assertEquals("48 hours", DateUtils.formatDuration(172800000));
    
public voidtest_formatDuration_Minutes()

        assertEquals("59 seconds", DateUtils.formatDuration(59000));
        assertEquals("60 seconds", DateUtils.formatDuration(59500));
        assertEquals("1 minute", DateUtils.formatDuration(60000));
        assertEquals("2 minutes", DateUtils.formatDuration(120000));
    
public voidtest_formatDuration_seconds()

        assertEquals("0 seconds", DateUtils.formatDuration(0));
        assertEquals("0 seconds", DateUtils.formatDuration(1));
        assertEquals("0 seconds", DateUtils.formatDuration(499));
        assertEquals("1 second", DateUtils.formatDuration(500));
        assertEquals("1 second", DateUtils.formatDuration(1000));
        assertEquals("2 seconds", DateUtils.formatDuration(1500));