What problem does it solve? Apex test suites in fflib (Apex Enterprise Patterns) codebases often mix mocked and real-DML tests incorrectly, producing high coverage numbers that prove nothing about SOQL, triggers, validation rules, or security. This Skill guides the choice between 14 test variants and provides verified patterns for ApexMocks stubbing, verification, matchers, and fake data so tests are fast, meaningful, and pass coverage gates. ## Core Features & Use Cases - Test-variant decision table: Choose among mocked service tests, no-DML domain tests, real-DML selector tests, async/batch/schedulable tests, platform-event tests, callout mocks, and FLS/CRUD negative tests based on what each variant can actually prove. - ApexMocks lifecycle patterns: Correct startStubbing/when/thenReturn/stopStubbing usage, verification modes (times, atLeast, between, InOrder), argument matchers, ArgumentCaptor, and Application.*.setMock injection. - Fake data construction: Build SObject graphs without DML using fflib_IDGenerator, makeRelationship for subquery results, and setReadOnlyFields for formula and audit fields. - Use Case: A developer's mock verification fails with EXPECTED COUNT: 1 / ACTUAL COUNT: 0. Use this Skill to diagnose whether the cause is missing setMock injection, mismatched arguments, or a leaked matcher, then fix the test. ## Quick Start Ask the assistant to write a mocked unit test for an fflib service class that verifies the selector call and Unit of Work registration.