New Year Sale ! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam DEX-450 Topic 8 Question 83 Discussion

Actual exam question for Salesforce's DEX-450 exam
Question #: 83
Topic #: 8
[All DEX-450 Questions]

A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object,

Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.

hich two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: A, C

Contribute your Thoughts:

Carissa
6 months ago
I have used the @testSetup annotation in the past to ensure test data is available. It's another approach to consider.
upvoted 0 times
...
Whitley
6 months ago
I'd be careful with @isTest(seeAllData=true) - that can lead to some tricky test data issues down the line. A and C seem like the safer bets here.
upvoted 0 times
Velda
5 months ago
Definitely, we should avoid using @isTest(seeAllData=true) to prevent test data issues.
upvoted 0 times
...
Micaela
5 months ago
Yeah, I think using Test.startTest{} method is also a safe option.
upvoted 0 times
...
Roslyn
6 months ago
I agree, using a Test Data Factory class is a good approach.
upvoted 0 times
...
...
Marvel
6 months ago
I believe using the Test.loadData{} method is also a valid option to ensure Pricing Structure records are available.
upvoted 0 times
...
Carmela
6 months ago
I agree with Felicidad, utilizing a Test Data Factory class is a recommended practice.
upvoted 0 times
...
Felicidad
6 months ago
I think using a Test Data Factory class would be a good approach.
upvoted 0 times
...
Jackie
7 months ago
Haha, 'without shering on the class declaration'? I think that one's a typo, folks. Let's go with A and C - can't go wrong with good old test data factories!
upvoted 0 times
Amie
6 months ago
Yeah, using a Test Data Factory class and the Test.loadData{} method is a solid approach for this scenario.
upvoted 0 times
...
Casandra
6 months ago
I agree, test data factories are always reliable for ensuring records are available.
upvoted 0 times
...
...
Estrella
7 months ago
Hmm, I'm not sure about using @isTest(seeAllData=true) - I heard that's not a recommended practice these days. Maybe stick to the data factories or Test.loadData{}.
upvoted 0 times
Kallie
6 months ago
Yeah, data factories are definitely more reliable for test classes.
upvoted 0 times
...
Pamella
6 months ago
I agree, using Test.loadData{} is a safer option.
upvoted 0 times
...
...
Vilma
7 months ago
That's a good point, Yuette. It's important to consider all options to make sure the test class runs smoothly.
upvoted 0 times
...
Rachael
7 months ago
A and C look like good options to me. Using the Test.loadData{} method seems like the most straightforward way to get the Pricing_Structure__c records loaded for the test class.
upvoted 0 times
Stevie
6 months ago
C) Use the Test.loadData{} method.
upvoted 0 times
...
Whitley
6 months ago
A) Use a Test Data Factory class.
upvoted 0 times
...
...
Yuette
7 months ago
I also think using the @IsTest(seeAllData=true) annotation could work to access the existing records.
upvoted 0 times
...
Filiberto
7 months ago
I agree with Vilma, a Test Data Factory class would be a good approach to ensure the records are available during testing.
upvoted 0 times
...
Vilma
7 months ago
I think we can use a Test Data Factory class to create necessary records.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77