package jscl.math.operator;

import org.junit.Test;

/**
 * User: serso
 * Date: 12/26/11
 * Time: 11:15 AM
 */
public class MeanTest {

    @Test
    public void testEvaluate() throws Exception {
        /*MathEngine me = JsclMathEngine.instance;
          try {
              me.evaluate("mean()");
              Assert.fail();
          } catch (ParseException e) {
              // ok
          }

          Assert.assertEquals("0", me.evaluate("mean([0])"));
          Assert.assertEquals("5.0", me.evaluate("mean([10, 0])"));
          Assert.assertEquals("100+mean([10, 0]%)", me.evaluate("100 + mean([10, 0]%)"));
          Assert.assertEquals("105.0", me.evaluate("100 + mean([10, 0])"));
          Assert.assertEquals("105.0", me.evaluate("100 + mean([10, 0])%"));
          Assert.assertEquals("10", me.evaluate("mean([10])"));
          Assert.assertEquals("15.0", me.evaluate("mean([10, 20])"));
          Assert.assertEquals("0.5602494390798607", me.evaluate("mean([sin(7), cos(3)])"));
          Assert.assertEquals("0.5", me.evaluate("mean([1, 0])"));
          Assert.assertEquals("0.8", me.evaluate("mean([1, 0, 1, 1, 1])"));
          Assert.assertEquals("0.8", me.evaluate("mean([0.5+mean([1, 0]), 0, sin(90), 1, 1])"));*/
    }
}
