© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
K. KapitanovSalesforce Developer I CertificationCertification Study Companion Serieshttps://doi.org/10.1007/979-8-8688-0300-0_9

9. Testing

Konstantin Kapitanov1  
(1)
Borås, Sweden
 

9.1 How to Write Test Cases

Unit tests in Apex are written using the Apex testing framework, which provides a set of classes and methods specifically designed for testing Apex code. These tests are typically written by developers to validate the functionality of their code and ensure that it meets the desired requirements.

In Salesforce, before moving the code to production, a minimum of 75% code coverage is required. This means that at least 75% of your Apex code must be covered by ...

Get Salesforce Developer I Certification: Learn the Basics of Apex, Lightning Web Components, and Flow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.