Salesforce Platform Developer I (legacy) — Question 20
A developer created a Visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page.
What should the developer do to deploy to production?
Answer options
- A. Create a test class that provides coverage of the Visualforce page.
- B. Create a test page that provides coverage of the Visualforce page.
- C. Create a test page that provides coverage of the custom controller.
- D. Create a test class that provides coverage of the custom controller.
Correct answer: D
Explanation
The correct answer is D because Salesforce requires test classes to cover the logic implemented in custom controllers before deployment. Options A, B, and C are incorrect as they do not focus on the custom controller, which is essential for the functionality of the Visualforce page.