diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-28 12:36:29 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-28 12:36:29 +0000 |
| commit | f78189def02911d1de26db1d60eefcaf935ffbbf (patch) | |
| tree | ada415e325d5453df42e9ff0852f7afb5c0723de /src/test/java/org/zwobble/mammoth | |
| parent | 9085e20dfdc9883e4eafebdac342fc5ade851659 (diff) | |
Add BreakMatcher
Diffstat (limited to 'src/test/java/org/zwobble/mammoth')
| -rw-r--r-- | src/test/java/org/zwobble/mammoth/tests/styles/BreakMatcherTests.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/styles/BreakMatcherTests.java b/src/test/java/org/zwobble/mammoth/tests/styles/BreakMatcherTests.java new file mode 100644 index 0000000..f33ef72 --- /dev/null +++ b/src/test/java/org/zwobble/mammoth/tests/styles/BreakMatcherTests.java @@ -0,0 +1,22 @@ +package org.zwobble.mammoth.tests.styles; + +import org.junit.Test; +import org.zwobble.mammoth.internal.documents.Break; +import org.zwobble.mammoth.internal.styles.BreakMatcher; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; + +public class BreakMatcherTests { + @Test + public void whenBreakHasDifferentTypeToBreakMatcherThenMatchFails() { + assertThat(BreakMatcher.LINE_BREAK.matches(Break.PAGE_BREAK), equalTo(false)); + assertThat(BreakMatcher.PAGE_BREAK.matches(Break.LINE_BREAK), equalTo(false)); + } + + @Test + public void whenBreakHasTheSameTypeAsBreakMatcherThenMatchSucceeds() { + assertThat(BreakMatcher.LINE_BREAK.matches(Break.LINE_BREAK), equalTo(true)); + assertThat(BreakMatcher.PAGE_BREAK.matches(Break.PAGE_BREAK), equalTo(true)); + } +} |
