@Test
public void evaluateAggregate(){

	FieldName name = new FieldName("x");
	List<?> values = Arrays.asList(TypeUtil.parse(DataType.DATE, "2013-01-01"), TypeUtil.parse(DataType.DATE, "2013-02-01"), TypeUtil.parse(DataType.DATE, "2013-03-01"));
	EvaluationContext context = createContext(name, values);
	Aggregate aggregate = new Aggregate(name, Aggregate.Function.COUNT);
	assertEquals(3, evaluate(aggregate, context));
	aggregate.setFunction(Aggregate.Function.MIN);
	assertEquals(values.get(0), evaluate(aggregate, context));
	aggregate.setFunction(Aggregate.Function.MAX);
	assertEquals(values.get(2), evaluate(aggregate, context));
}