Unit tests for wrapMethod and wrapFunction