package unitTest;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class FunctionTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void test() {
		fail("Not yet implemented");
	}

}

@@ -47,16 +47,45 @@
 ert.*;%0A%0A
+import java.util.ArrayList;%0A%0A
 import o
@@ -125,16 +125,33 @@
 .Test;%0A%0A
+import model.*;%0A%0A
 public c
@@ -169,16 +169,66 @@
 onTest %7B
+%0A%09Function func;%0A%09Function pfunc;%0A%09Variable x,y,z;
 %0A%0A%09@Befo
@@ -275,68 +275,971 @@
  %7B%0A%09
-%7D%0A%0A%09@Test%0A%09public void test() %7B%0A%09%09fail(%22Not yet implemented%22
+%09x = new Variable('x',-2);%0A%09%09y = new Variable('y',1);%0A%09%09z = new Variable('z',3);%0A%09%09%0A%09%09ArrayList%3CExpression%3E pExp = new ArrayList%3C%3E();%0A%09%09pExp.add(new Power(x, new Constant(3.0)));%0A%09%09pExp.add(new Power(y, new Constant(3.0)));%0A%09%09pExp.add(new Power(z, new Constant(3.0)));%0A%09%09pExp.add(new Multiply(new Power(x, new Constant(1.0)), new Multiply(new Power(y, new Constant(1.0)), new Power(z, new Constant(1.0))),-3.0));%0A%09%09%0A%09%09func = new Function(new Sine(new Power(x,new Constant(1.0))));%0A%09%09pfunc = new Function(new Add(pExp));%0A%09%7D%0A%0A%09@Test%0A%09public void testCalc() throws Exception %7B%0A%09%09assertEquals(38.0 , pfunc.calc(), 0.0000001);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testDeriv() throws Exception %7B%0A%09%09assertEquals(33.0, pfunc.getDerivative('z').calc(), 0.0000001);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testIsContinuous() throws Exception %7B%0A%09%09assertEquals(true, func.isContinuous(-2));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testIsDerivativable() throws Exception %7B%0A%09%09assertEquals(true, func.isDerivativable(-1)
 );%0A%09

test case for Function class