Which statement is unnecessary inside the unit test for the custom - ProProfs Discuss
Advertisement

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 subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter, on the initial URL 

This question is part of Salesforce Platform Developer 1
Asked by Cmduquer, Last updated: Nov 18, 2020

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

drmcgee2000

drmcgee

drmcgee2000
Drmcgee

Answered Feb 13, 2020

String nextPage = controller.save().getUrl(); this line is just silly.

upvote downvote
Reply 

M. Porter

M. Porter

Here to relax my mind a bit

M. Porter
M. Porter, Senior Executive, Master of Art, San Jose

Answered Jan 25, 2019

The statement that is unnecessary is Public ExtendedController (ApexPages.StandardController cntrl) { } Another possible statement that is not needed in order to complete the task is String nextPage = controller.save().getUrl() Without these statements, it will be possible to create and edit multiple objects without many issues.

Unit tests are important because they can check if the codes that are available are working. If the code is not working properly, the only way to deal with that code is to remove it. It will be pointless to create arguments or to do some justifications with some of the codes that are not working. Either they can be changed to work or they will just be removed.

upvote downvote
Reply 

cmduquer

cmduquer

cmduquer
Cmduquer

Answered Oct 26, 2018

Public ExtendedController (ApexPages.StandardController cntrl) { }
String nextPage = controller.save().getUrl();

####
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

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