Free DEX-450 Exam Braindumps (page: 5)

Page 4 of 115

Which approach should be used to provide test data for a test class?

  1. Query for existing records in the database.
  2. Execute anonymous code blocks that create data.
  3. Use a test data factory class to create test data.
  4. Access data in @TestVisible class variables.

Answer(s): C



Which approach should a developer take to automatically add a "Maintenance Plan" to each Opportunity that includes an "Annual Subscription" when an opportunity is closed?

  1. Build a OpportunityLineItem trigger that adds a PriceBookEntry record.
  2. Build an OpportunityLineItem trigger to add an OpportunityLineItem record.
  3. Build an Opportunity trigger that adds a PriceBookEntry record.
  4. Build an Opportunity trigger that adds an OpportunityLineItem record.

Answer(s): D



Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

  1. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
  2. Test data is inserted once for all test methods in a class.
  3. Records created in the @testSetup method cannot be updates in individual test methods.
  4. The @testSetup method is automatically executed before each test method in the test class is executed.

Answer(s): D



What is the requirement for a class to be used as a custom Visualforce controller?

  1. Any top-level Apex class that has a constructor that returns a PageReference
  2. Any top-level Apex class that extends a PageReference
  3. Any top-level Apex class that has a default, no-argument constructor
  4. Any top-level Apex class that implements the controller interface

Answer(s): D






Post your Comments and Discuss Salesforce DEX-450 exam with other Community members:

DEX-450 Discussions & Posts