package com.wesleyhome.math.equation;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Before;
import org.junit.Test;
import com.wesleyhome.math.equation.FunctionException;
public class FunctionExceptionTest {
private static final String MESSAGE = "Message";
private FunctionException exception;
@Before
public void setUp() throws Exception {
exception = new FunctionException(MESSAGE);
}
@Test
public void testExceptionInstanceOf() throws Exception {
assertThat(exception, is(instanceOf(RuntimeException.class)));
}
@Test
public void testExceptionCause() throws Exception {
assertThat(exception.getCause(), is(nullValue()));
}
@Test
public void testExceptionMessage() throws Exception {
assertThat(exception.getMessage(), is(equalTo(MESSAGE)));
}
}