Which statement is unnecessary inside the unit test for the custom - ProProfs Discuss
Topics
Products
Follow Us:

Which statement is unnecessary inside the unit test for the custom controller? A developer has a single custom controller class that works with a visualforce wizard to support creating and editing multiple SObjects. The wizard accepts data from user inputs across multiple visualforce apges and from a parameter on the initial URL.



A. Public Extendedcontroller(apexPages.StandardController cntrl){}
B. Apex.Pages.CurrentPage().getParameters().put( input , TestValue );
C. Test.setCurrentpage(pageRef);
D. String nextpage =controller.save().getURL();

This question is part of Platform Dev I
Asked by Faron, Last updated: Aug 06, 2020

+ Answer
Request

3 Answers

W. Pratt

Want to learn new things and share my knowledge

W. Pratt, Marketing Analyst, MBA, Lincoln

Answered Mar 20, 2019

The answer to this is D. This is the command needed to make sure that the wizard will accept the data from different Salesforce Pages. If this would not be the command that will be used, it may not work. B and C will not be effective because they are only focused on getting information from the current pages which are not exactly what you would like to do. You want to get information from all the pages that are currently there.

Doing this will allow important information to be available easily without having to do a lot of processes in the first place.

 

John Adney

John Adney

Answered Aug 29, 2017

For B and C I can understand. Can you please explan why answer is not A ?

 

John Smith

John Smith

Answered May 09, 2017

String nextpage =controller.save().getURL();
 

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.