Added ability to specify the function when creating a unittest