Which edit should the developer make to ensure the test class runs successfully?
Consider the following code snippet:
A developer created the following test class to provide the proper code coverage for the snippet above:
However, when the test runs, no data is returned and the assertion fails.
Which edit should the developer make to ensure the test class runs successfully?
A . Enclose the method call within Test. startTest () and Test , stop Test ()
B. Implement the seeAllData=true attribute in the @isTest annotation.
C. Implement the without sharing keyword in the searchfeature Apex class.
D. Implement the setFixedSearchResults method in the test class.
Answer: D
Latest PDII Practice Questions with 280 Q&As
Updated Study Material | Instant Download | Detailed Answers and Explanations
Subscribe
Login
0 Comments