aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/documents/StyleTests.java
blob: 68b07c69989849270a465fe0eb92ca584a0a1b49 (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.documents;

import org.junit.Test;
import org.zwobble.mammoth.documents.Style;

import java.util.Optional;

import static org.junit.Assert.assertEquals;

public class StyleTests {
    @Test
    public void descriptionOfStyleIncludesBothIdAndNameIfPresent() {
        Style style = new Style("Heading1", Optional.of("Heading 1"));
        assertEquals("Heading 1 (Style ID: Heading1)", style.describe());
    }

    @Test
    public void descriptionOfStyleIsJustStyleIdIfStyleNameIsMissing() {
        Style style = new Style("Heading1", Optional.empty());
        assertEquals("Style ID: Heading1", style.describe());
    }
}