-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathImageFormatTest.java
More file actions
21 lines (16 loc) · 1013 Bytes
/
ImageFormatTest.java
File metadata and controls
21 lines (16 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package nodebox.client;
import junit.framework.TestCase;
import java.io.File;
public class ImageFormatTest extends TestCase {
public void testEnsureFileFormat() {
assertEquals("test.pdf", ImageFormat.PDF.ensureFileExtension("test"));
assertEquals("test.pdf", ImageFormat.PDF.ensureFileExtension("test.pdf"));
assertEquals("test..pdf", ImageFormat.PDF.ensureFileExtension("test."));
assertEquals("test.png.pdf", ImageFormat.PDF.ensureFileExtension("test.png"));
assertEquals("test.something.pdf", ImageFormat.PDF.ensureFileExtension("test.something"));
assertEquals("a.b.c.pdf", ImageFormat.PDF.ensureFileExtension("a.b.c"));
assertEquals("/a/b/c.pdf", ImageFormat.PDF.ensureFileExtension("/a/b/c"));
assertEquals("/a/b/c.png.pdf", ImageFormat.PDF.ensureFileExtension("/a/b/c.png"));
assertEquals(new File("/a/b.test/c.pdf").getAbsolutePath(), ImageFormat.PDF.ensureFileExtension(new File("/a/b.test/c")).getAbsolutePath());
}
}