Mocking for functions with dynamic parameters