Refactored Search tests to be more robust