CRT-450 Exam QuestionsBrowse all questions from this exam

CRT-450 Exam - Question 273


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.

Which two approaches can the developer use to ensure Pricing_Structure__c records are available when the test class is executed? (Choose two.)

Show Answer
Correct Answer: ABC

To ensure that Pricing_Structure__c records are available when the test class is executed, a developer can use the @IsTest(SeeAllData=true) annotation to access the existing data in the org and a Test Data Factory class to create test data programmatically. Using the @IsTest(SeeAllData=true) annotation ensures that real data in the custom object is available for the test, but it is generally not recommended for new tests due to potential issues with data dependencies. A Test Data Factory allows the developer to programmatically create fresh, relevant test data to ensure that tests are reliable and self-contained.

Discussion

1 comment
Sign in to comment
SS1121Options: BC
Jun 17, 2024

Option A seems incorrect or it should be Test.loadData()