May 2019
Intermediate to advanced
546 pages
12h 41m
English
While running your tests and testing their execution, you don't want real data being created or modified in your production organization. Everything that your code does, creates, or updates while testing will be rolled back after the test is finished. For this reason, tests are run in an empty, simulated organization. It's as if you would just have gotten a brand new database from Salesforce without any records in the database.
This means that while running tests, you can't just query for any account and do something with it. You need to create all the records that you need for testing first!
There are some exceptions where you don't need to create the data or you cannot create the data:
Read now
Unlock full access