I would define this method outside of the tests, so that you aren't re-defining it in each test case.