@Test
public void evaluateApply(){

	FieldName name = FieldName.create("x");
	Apply apply = new Apply(PMMLFunctions.DIVIDE)
		.addExpressions(new FieldRef(name), new Constant("0"));
	assertEquals(null, evaluate(apply, name, null));
	apply.setDefaultValue("-1");
	assertEquals("-1", evaluate(apply, name, null));
	apply.setMapMissingTo("missing");
	assertEquals("missing", evaluate(apply, name, null));
	apply.setInvalidValueTreatment(InvalidValueTreatmentMethod.RETURN_INVALID);
	try {
		evaluate(apply, name, 1);
		fail();
	} catch(InvalidResultException ire){
		// Ignored
	}
	apply.setInvalidValueTreatment(InvalidValueTreatmentMethod.AS_IS);
	try {
		evaluate(apply, name, 1);
		fail();
	} catch(InvalidResultException ire){
		// Ignored
	}
	apply.setInvalidValueTreatment(InvalidValueTreatmentMethod.AS_MISSING);
	assertEquals("-1", evaluate(apply, name, 1));
}