@Test
	public void functionWithWhile() {
		DataFactory factory = new DataFactory();
		Context context = new Context();
		HashMap map = new HashMap();
		While w = factory.createWhile();
		Function f = factory.createFunction();

		IVPValue maximumValue = factory.createIVPNumber();
		maximumValue.setValueType(IVPValue.INTEGER_TYPE);
		f.addConstant(maximumValue, "9", context, map);

		IVPValue one = factory.createIVPNumber();
		one.setValueType(IVPValue.INTEGER_TYPE);
		f.addConstant(one, "1", context, map);

		IVPVariable v = factory.createIVPVariable();
		v.setVariableType(IVPValue.INTEGER_TYPE);
		v.setVariableName("var1");
		f.addVariable(v, "1", context, map, factory);

		LessThanOrEqualTo leq = factory.createLessThanOrEqualTo();
		leq.setExpressionA(v.getUniqueID());
		leq.setExpressionB(maximumValue.getUniqueID());

		Addition add = factory.createAddition();
		add.setExpressionA(v.getUniqueID());
		add.setExpressionB(one.getUniqueID());

		AttributionLine attLine = factory.createAttributionLine();
		attLine.setVariable(v.getUniqueID());
		attLine.setExpression(add.getUniqueID());

		map.put(add.getUniqueID(), add);
		map.put(leq.getUniqueID(), leq);
		map.put(attLine.getUniqueID(), attLine);
		map.put(w.getUniqueID(), w);
		map.put(f.getUniqueID(), f);
		context.setFunctionID(f.getUniqueID());

		w.setLoopCondition(leq.getUniqueID());
		w.addChild(attLine.getUniqueID());

		f.addChild(w.getUniqueID());

		f.evaluate(context, map, factory);

		IVPNumber result = (IVPNumber) v.evaluate(context, map, factory);
		assertTrue(context.getInt(result.getUniqueID()) == 10);
	}