With test cases using mock.