package org.zwobble.mammoth.tests; import org.junit.Test; import org.zwobble.mammoth.Mammoth; import org.zwobble.mammoth.results.Result; import java.io.File; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.zwobble.mammoth.results.Result.success; import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals; public class MammothTests { @Test public void emptyParagraphsAreIgnoredByDefault() { assertThat( convertToHtml("empty.docx").getValue(), is("")); } @Test public void docxContainingOneParagraphIsConvertedToSingleParagraphElement() { assertThat( convertToHtml("single-paragraph.docx"), deepEquals(success("

Walking on imported air

"))); } private Result convertToHtml(String name) { File file = TestData.file(name); return Mammoth.convertToHtml(file); } }