Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Salesforce logo

SalesforceCertified Platform Developer II

Domain 7Objective 1

Describe the Best Practices for Unit Testing in Apex. PLATFORM-DEVELOPER-II Practice Questions (Page 4)

Part of the TESTING domain, which accounts for 7% of the PLATFORM-DEVELOPER-II exam.

31questions here
7free pages
10concepts
7%of the exam

Questions 16–20

  1. 16application · easy

    A developer is writing a test for a method that returns a list of Account names. The method should return an empty list when no Accounts exist. Which assertion should the developer use to verify this behavior?

    Select an answer first
  2. 17application · medium

    A developer is testing a method that returns a list of Account names sorted alphabetically. The test creates three Accounts with names 'Beta', 'Alpha', and 'Gamma'. Which assertion verifies the correct sorting?

    Select an answer first
  3. 18application · medium

    A developer is writing a test for a class that calculates the total value of all Opportunities for an Account. The test creates an Account and two Opportunities. The developer wants to ensure the test is isolated and does not depend on other data in the org. What is the best practice for creating the test data?

    Select an answer first
  4. 19expert · medium

    A developer is testing a batch class that processes Accounts and makes a callout for each one. The batch is designed to process up to 100 Accounts per batch. The developer wants to verify that the batch does not exceed the callout limit. Which test approach is correct?

    Select an answer first
  5. 20foundation · easy

    What is the correct way to define a class that contains only Apex unit test methods?

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Salesforce. “PLATFORM-DEVELOPER-II” is a trademark of its owner, used for identification only.