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