Added tests to FilenameGenerator

This commit is contained in:
daniel oeh 2013-03-25 11:05:53 +01:00
parent 162aa9afcf
commit f4fa334abf
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@ public class FilenameGeneratorTest extends AndroidTestCase {
private static final String VALID1 = "abc abc";
private static final String INVALID1 = "ab/c: <abc";
private static final String INVALID2 = "abc abc ";
public void testGenerateFileName() throws IOException {
String result = FileNameGenerator.generateFileName(VALID1);
@ -23,6 +24,12 @@ public class FilenameGeneratorTest extends AndroidTestCase {
createFiles(result);
}
public void testGenerateFileName2() throws IOException {
String result = FileNameGenerator.generateFileName(INVALID2);
assertEquals(result, VALID1);
createFiles(result);
}
/**
* Tests if files can be created.
*