blob: 47fca41bae3778fc43a9879f551d22d0615c1d0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package de.test.antennapod.util;
import android.test.AndroidTestCase;
import de.danoeh.antennapod.core.util.Converter;
/**
* Test class for converter
*/
public class ConverterTest extends AndroidTestCase {
public void testGetDurationStringLong() throws Exception {
String expected = "13:05:10";
int input = 47110000;
assertEquals(expected, Converter.getDurationStringLong(input));
}
public void testGetDurationStringShort() throws Exception {
String expected = "13:05";
int input = 47110000;
assertEquals(expected, Converter.getDurationStringShort(input));
}
public void testDurationStringLongToMs() throws Exception {
String input = "01:20:30";
long expected = 4830000;
assertEquals(expected, Converter.durationStringLongToMs(input));
}
public void testDurationStringShortToMs() throws Exception {
String input = "8:30";
long expected = 30600000;
assertEquals(expected, Converter.durationStringShortToMs(input));
}
}
|