a function mocker that generate mocked function automatically