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 CRT-450 Topic 4 Question 45 Discussion

Actual exam question for Salesforce's CRT-450 exam
Question #: 45
Topic #: 4
[All CRT-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:

Micaela
6 months ago
I'm not sure about D, but A and C seem like the most reliable options to make sure the test data is prepped properly. Can't go wrong with those.
upvoted 0 times
Myra
5 months ago
C) Use the Test.loadData{} method.
upvoted 0 times
...
Yvonne
5 months ago
B) Use the @IsTest(seeAllData=true) annotation.
upvoted 0 times
...
William
6 months ago
A) Use a Test Data Factory class.
upvoted 0 times
...
...
France
6 months ago
I'm not sure about the @testSetup annotation, it might not work for this scenario.
upvoted 0 times
...
Cathrine
6 months ago
Haha, 'without shering on the class declaration'? I think they meant 'without sharing', but that's a pretty funny typo. Anyway, I'd go with A and C as well.
upvoted 0 times
Brett
5 months ago
Definitely, those two options should ensure the Pricing Structure records are available for testing.
upvoted 0 times
...
Ligia
5 months ago
I agree, using the Test.startTest{} method is also a solid choice.
upvoted 0 times
...
Jess
5 months ago
Yeah, that typo made me chuckle too. A Test Date Factory class sounds like a good idea.
upvoted 0 times
...
...
Louis
6 months ago
I also think using the Test.loadData{} method could be a good option to ensure the data is available.
upvoted 0 times
...
Flo
6 months ago
I agree, it would ensure the Pricing Structure records are available during the test.
upvoted 0 times
...
Milly
7 months ago
I would avoid using @isTest(seeAllData=true) if possible. That can make the tests more fragile and dependent on external data. A and C seem like the safer choices.
upvoted 0 times
Sabra
5 months ago
Yeah, I think using the Test.startTest{} method is also a safe choice.
upvoted 0 times
...
Crissy
6 months ago
Yes, using Test.loadData{} method is also a safe choice.
upvoted 0 times
...
Sage
6 months ago
I agree, using a Test Data Factory class is a good approach.
upvoted 0 times
...
Quentin
6 months ago
I think using a Test Data Factory class is a good approach.
upvoted 0 times
...
Fabiola
6 months ago
I agree, using @isTest(seeAllData=true) can make tests fragile.
upvoted 0 times
...
...
Marsha
7 months ago
A and C look like good options to me. We definitely need to ensure the test data is available, and the Test.loadData{} method seems like the way to go.
upvoted 0 times
Nilsa
6 months ago
I agree, using Test.loadData{} method should do the trick.
upvoted 0 times
...
Buck
6 months ago
A and C are good choices. We need to make sure the test data is there.
upvoted 0 times
...
Blondell
6 months ago
C) Use the Test.loadData{} method.
upvoted 0 times
...
Yen
7 months ago
A) Use a Test Data Factory class.
upvoted 0 times
...
...
Tandra
7 months ago
I think using a Test Data Factory class is a good approach.
upvoted 0 times
...
Shawna
7 months ago
I agree with Nan, having access to all data is crucial for testing complex pricing structures.
upvoted 0 times
...
Nan
7 months ago
I think using the @raTeat (seeAllData=true) annotation is essential for this scenario.
upvoted 0 times
...
Jestine
7 months ago
I disagree, I believe option B) and D) are more appropriate choices.
upvoted 0 times
...
Son
7 months ago
I think option A) and C) should be used.
upvoted 0 times
...

Save Cancel