Skip to content
Home » Blog

Blog

Aleš Remta (me)

Pragmatic Bears’ Way shared by Aleš Remta. Using Twitter to learn about Release notes, adjusting VS Code and more

Metal Worker

Class Factory

TL; DR; Standardising mocking throughout your code base in the simplest way possible without mixing test-only and production code. See on GitHub or below (in full) The Problem Mocking in (Apex) unit tests is very useful. There are, however, a few challenges to it. How exactly do you replace the… Read More »Class Factory

DML (Mock) Service

TL; DR; Apex utility wrapping DML operations and logging their results consistently. And a mock version of the same allowing to do “pretend” DML in Unit Tests. Full source on GitHub (link). The Problem Not really a problem to be honest. It started with a desire to reduce duplication in… Read More »DML (Mock) Service

Man stretching

Flexible Mock

Writing good tests is hard. Complex repetitive setup code is often seen and tests run very slow. One way to improve is to gradually introduce mocking. The post tries to make this as easy as possible.