A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. Which step should the developer take to resolve the issue and properly test the exception?

QuestionsCategory: CRT-450A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. Which step should the developer take to resolve the issue and properly test the exception?
Admin Staff asked 4 months ago
A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown.
Which step should the developer take to resolve the issue and properly test the exception?

A. Use try/catch within the unit test to catch the exception.

B. Use the finally bloc within the unit test to populate the exception.

C. Use the database methods with all or none set to FALSE.

D. Use Test.isRunningTest() within the custom controller.








 

Suggested Answer: A





This question is in CRT-450 Salesforce Certified Platform Developer I Exam
For getting Salesforce Certified Platform Developer I











Disclaimers:
The website is not related to, affiliated with, endorsed or authorized by Salesforce. 
Trademarks, certification & product names are used for reference only and belong to Salesforce.
The website does not contain actual questions and answers from Salesforce's Certification Exams.

Recommended

Welcome Back!

Login to your account below

Create New Account!

Fill the forms below to register

Retrieve your password

Please enter your username or email address to reset your password.