Mockery test case

Solution for #376