Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Platform Developer I Topic 1 Question 69 Discussion

Actual exam question for Salesforce's Platform Developer I exam
Question #: 69
Topic #: 1
[All Platform Developer I Questions]

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 pages and from a parameter on the initial URL.

Which three statements are useful inside the unit test to effectively test the custom controller?

Choose 3 answers

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Leontine
1 months ago
A, E, and C seem like the way to go. Can't forget to test that save() method, and setting the current page is always a must-have.
upvoted 0 times
...
Alva
2 months ago
Haha, E is a classic - setting the current page for the test. Gotta love those Salesforce unit test shenanigans!
upvoted 0 times
Ranee
7 days ago
User 4: Agreed, those are key elements for effective unit testing.
upvoted 0 times
...
Selma
9 days ago
User 3: I also think inserting the page reference is important for testing.
upvoted 0 times
...
Virgie
12 days ago
User 2: Definitely, it helps ensure the controller behaves as expected.
upvoted 0 times
...
Christiane
24 days ago
User 1: Yeah, setting the current page for the test is always a must.
upvoted 0 times
...
...
Nikita
2 months ago
D looks interesting, but it's not one of the 3 options we're supposed to choose. I wonder if that's a trick question or if the controller has some sort of constructor we should be testing.
upvoted 0 times
Kimberlie
1 months ago
D) public Extendedcontroller (ApexPages.Standardcontraller entrl) { }
upvoted 0 times
...
Elvera
1 months ago
B) ApexPages.currentPage ().getParametera(}.put{'input', 'TeatValue');
upvoted 0 times
...
Jani
1 months ago
A) String nextPage = controller.save().getUrl ();
upvoted 0 times
...
...
Sunny
2 months ago
B doesn't look like it's testing anything specific to the custom controller. Putting a parameter on the current page isn't quite the same as testing the controller itself.
upvoted 0 times
...
Yesenia
2 months ago
A, E, and C seem like the most relevant options to effectively test the custom controller. Gotta make sure that save() method is working properly and that we can set the current page for the test.
upvoted 0 times
Ronny
26 days ago
C) insert pageret;
upvoted 0 times
...
Nathalie
1 months ago
E) Test. setCurrentPage (pageRef) ;
upvoted 0 times
...
Domonique
2 months ago
A) String nextPage = controller.save().getUrl ();
upvoted 0 times
...
...
Delfina
2 months ago
I believe option E is necessary to set the current page for testing purposes.
upvoted 0 times
...
Caren
2 months ago
I agree with you, Lashaun. Option C is also important to test the insertion of records.
upvoted 0 times
...
Lashaun
2 months ago
I think option A is useful because it checks the URL after saving.
upvoted 0 times
...

Save Cancel