blob: f0d19e395c59632f11260d26046f2772708dcada (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package org.zwobble.mammoth.tests.styles;
import org.junit.jupiter.api.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));
}
}
|