You need to sign in to do that
Don't have an account?

Writing a test class for CustomSearchController
Hi all,
I'm attempting to deploy the CustomSearchController class as written in the official developer documentation here:
https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_example_search.htm
However I can't see any instruction for writing the test class required. Can anyone please help with this?
Thanks,
Tristan
I'm attempting to deploy the CustomSearchController class as written in the official developer documentation here:
https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_example_search.htm
public class CustomSearchController { @AuraEnabled public static List<String> searchForIds(String searchText) { List<List<SObject>> results = [FIND :searchText IN ALL FIELDS RETURNING Account(Id), Campaign(Id), Contact(Id), Lead(Id)]; List<String> ids = new List<String>(); for (List<SObject> sobjs : results) { for (SObject sobj : sobjs) { ids.add(sobj.Id); } } return ids; } }
However I can't see any instruction for writing the test class required. Can anyone please help with this?
Thanks,
Tristan
Use the below to get the coverage.
Thanks
Sharat
All Answers
Use the below to get the coverage.
Thanks
Sharat