blob: 7966ceeec859e3d18c6f173f3aa99510a1e87190 (
plain)
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
|
package org.zwobble.mammoth.tests;
import org.junit.Test;
import org.zwobble.mammoth.Mammoth;
import org.zwobble.mammoth.Result;
import java.io.File;
import static org.junit.Assert.assertThat;
import static org.zwobble.mammoth.Result.success;
import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals;
public class MammothTests {
@Test
public void emptyParagraphsAreIgnoredByDefault() {
assertThat(
convertToHtml("empty.docx"),
deepEquals(success("")));
}
@Test
public void docxContainingOneParagraphIsConvertedToSingleParagraphElement() {
assertThat(
convertToHtml("single-paragraph.docx"),
deepEquals(success("<p>Walking on imported air</p>")));
}
private Result<String> convertToHtml(String name) {
File file = TestData.file(name);
return Mammoth.convertToHtml(file);
}
}
|