What is a best practice when unit testing a controller? - ProProfs Discuss
Topics
Products
Follow Us:

What is a best practice when unit testing a controller?



A. Simulate user interaction by leveraging Test.setMock().
B. Verify correct page references by using getURLU
C. Access test data by using seeAllData=true.
D. Set query parameters by using getParameters () .put

This question is part of PD2
Asked by Pal, Last updated: Jul 08, 2020

+ Answer
Request
1

3 Answers

Sue

Sue

Answered Jun 30, 2018

Https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_error_handling.htm

B. Verify correct page references by using getURLU
D. Set query parameters by using getParameters () .put

1
 

devilzP

DevilzP

Answered Apr 05, 2018

Simulate user interaction by leveraging Test.setMock().
Set query parameters by using getParameters () .put

 

Pal

Pal

Answered Feb 10, 2018

Simulate user interaction by leveraging Test.setMock().
Set query parameters by using getParameters () .put
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.