Add MockTestCase, refactoring