Set up search funtion with mocking test