Skip to content
Snippets Groups Projects
Commit 76df1fdb authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Unit tests for Tools

parent 6f27220c
No related branches found
No related tags found
No related merge requests found
......@@ -66,4 +66,5 @@ dependencies {
compile "com.android.support:support-v4:$rootProject.ext.appCompatVersion"
compile "com.android.support:support-compat:$rootProject.ext.appCompatVersion"
compile "com.android.support:support-fragment:$rootProject.ext.appCompatVersion"
testCompile 'junit:junit:4.12'
}
\ No newline at end of file
package org.videolan.medialibrary;
import junit.framework.TestCase;
public class ToolsTest extends TestCase {
public void testIsArrayEmpty() throws Exception {
}
public void testMillisToString() throws Exception {
assertEquals("3min30s", Tools.millisToString(210000, true));
assertEquals("3min", Tools.millisToString(180000, true));
assertEquals("1h30min30s", Tools.millisToString(5430000, true));
assertEquals("1h30min", Tools.millisToString(5400000, true));
assertEquals("1h30s", Tools.millisToString(3630000, true));
assertEquals("-32:40", Tools.millisToString(-1960000, false));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment