Added possibility to create test cases using a function.