Package com.wesleyhome.math.equation

Source Code of com.wesleyhome.math.equation.FunctionExceptionTest

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)));
  }
}
TOP

Related Classes of com.wesleyhome.math.equation.FunctionExceptionTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.