T.apex

  • Docs
  • Tutorials
Docs Menu
  • BDD Style
  • Mocking
    • Mock Creation
    • Mock Behavior
    • Argument Predicates
    • Mock Verification
  • Test Data

Mock Creation Guide

Mock Creation

How to Create Mocks

We only need one line to create a mock.

Func mock = (Func)T.mock(Func.class);

Behind the Scenes

We use Salesforce Apex Stub API to create mock objects. All limitations for Stub API also apply here.

Contribute on Github! Edit this section.