Salesforce Certified Platform Developer II (Plat-Dev-301) PDII Question # 45 Topic 5 Discussion

Salesforce Certified Platform Developer II (Plat-Dev-301) PDII Question # 45 Topic 5 Discussion

PDII Exam Topic 5 Question 45 Discussion:
Question #: 45
Topic #: 5

A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.

The following test fails:

PDII Question 45

What should be done to make this test pass?


A.

Create Accountdistory records manually in the test setup and write a query to get them.


B.

Use @isTest (SeeAllData=true] to see historical data from the org and query for Accountdistory records.


C.

Use Test. isRunningTest (] in getAccountHistory() to conditionally return fake AccountHistory records.


D.

The tact method should he delated since this code cannat be tested


Get Premium PDII Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.