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