package io.ljunggren.csv.parser.exception;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;

import org.junit.Test;

public class CsvParseExceptionTest {

    @Test
    public void messageOnlyConstructor() {
        CsvParseException e = new CsvParseException("boom");
        assertEquals("boom", e.getMessage());
        assertNull(e.getCause());
    }

    @Test
    public void messageAndCauseConstructor() {
        Throwable cause = new IllegalStateException("root");
        CsvParseException e = new CsvParseException("boom", cause);
        assertEquals("boom", e.getMessage());
        assertSame(cause, e.getCause());
    }

}
