Tests with mock