added before and after functions to test cases