package org.raddatz.familienarchiv.document;

import org.junit.jupiter.api.Test;
import org.raddatz.familienarchiv.document.MatchOffset;

import static org.assertj.core.api.Assertions.assertThat;

class MatchOffsetTest {

    @Test
    void should_hold_start_and_length() {
        MatchOffset offset = new MatchOffset(6, 5);

        assertThat(offset.start()).isEqualTo(6);
        assertThat(offset.length()).isEqualTo(5);
    }

    @Test
    void should_implement_value_equality() {
        assertThat(new MatchOffset(0, 3)).isEqualTo(new MatchOffset(0, 3));
        assertThat(new MatchOffset(0, 3)).isNotEqualTo(new MatchOffset(0, 4));
    }
}
