Added unit test for ReduceFunction