-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileFormatTest.java
More file actions
60 lines (51 loc) · 3.68 KB
/
FileFormatTest.java
File metadata and controls
60 lines (51 loc) · 3.68 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.aspose.html.tests;
import com.aspose.html.Utils;
import com.aspose.html.model.InputFormats;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;
public class FileFormatTest {
private static Stream<Arguments> data() {
return Stream.of(
Arguments.of("test.txt", null),
Arguments.of("test.html", InputFormats.HTML),
Arguments.of("test.htm", InputFormats.HTML),
Arguments.of("test.xml", InputFormats.XHTML),
Arguments.of("test.xhtml", InputFormats.XHTML),
Arguments.of("test.epub", InputFormats.EPUB),
Arguments.of("test.svg", InputFormats.SVG),
Arguments.of("test.md", InputFormats.MD),
Arguments.of("TEST.TXT", null),
Arguments.of("TEST.HTML", InputFormats.HTML),
Arguments.of("TEST.HTM", InputFormats.HTML),
Arguments.of("TEST.XML", InputFormats.XHTML),
Arguments.of("TEST.XHTML", InputFormats.XHTML),
Arguments.of("TEST.EPUB", InputFormats.EPUB),
Arguments.of("TEST.SVG", InputFormats.SVG),
Arguments.of("TEST.MD", InputFormats.MD),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.txt", null),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.html", InputFormats.HTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.htm", InputFormats.HTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.xml", InputFormats.XHTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.xhtml", InputFormats.XHTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.epub", InputFormats.EPUB),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.svg", InputFormats.SVG),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\test.md", InputFormats.MD),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.TXT", null),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.HTML", InputFormats.HTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.HTM", InputFormats.HTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.XML", InputFormats.XHTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.XHTML", InputFormats.XHTML),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.EPUB", InputFormats.EPUB),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.SVG", InputFormats.SVG),
Arguments.of("e:\\TEMP\\HtmlCloud\\html_cloud\\42dfae39-4058-4890-b33e-8af239860851\\TEST.MD", InputFormats.MD)
);
}
@ParameterizedTest
@MethodSource("data")
public void inputFormatsDetect(String input, InputFormats expected) {
Assertions.assertEquals(expected, Utils.getInputFormat(input));
}
}