So far, you've learned the basics about testing your Apex code and how you need to test an external call to a web service. You also learned that testing must use test data (and not real data) and that the data in these test scenarios isn't really submitted to your real database. After the execution of your test scenario, the data that's created for your test will be removed from memory. But what if you want to test and add data to your database? You have the Execute Anonymous Window for this. Hopefully, you remember this functionality from when we started with Apex in Chapter 4, Apex Basics. We used this functionality to write our first piece of code.
With this functionality, we can invoke classes and methods that are declared as a public or global class. The same is possible in a unit test, but the data isn...