Package com.wesleyhome.math.equation

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

package com.wesleyhome.math.equation;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Before;
import org.junit.Test;
import com.wesleyhome.math.equation.MaxFunction;

public class MaxFunctionTest {
  private MaxFunction function;

  @Before
  public void setUp() throws Exception {
    function = new MaxFunction();
  }

  @Test
  public void testGetName() throws Exception {
    assertThat(function.getName(), is(equalTo("max")));
  }

  @Test
  public void testEvaluate() throws Exception {
    Number maxNumber = function.evaluate(9, 1);
    Number expected = 9;
    assertThat(maxNumber, is(equalTo(expected)));
  }

  @Test
  public void testEval2() throws Exception {
    Number maxNumber = function.evaluate(9, 91);
    Number expected = 91;
    assertThat(maxNumber, is(equalTo(expected)));
  }
}
TOP

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

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.