function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
svidyansvidyan 

Testing Apex code

Hi,

 

I'm new to Apex development. I understand that the Apex code must be accompanied by test cases.

 

My question is when I insert data into the Force.com database for the testcases, does this data reside along with the production data?

 

How do I make the database data just available for test cases only? Do I have to remove the data explicitly after the tests have executed?

 

Thanks

Svidya

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The test data will be added to the production data during your test, but it won't exist after your test has completed as the entire transaction is rolled back at the end.