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