O'Reilly logo

Mastering Application Development with Force.com by Kevin J. Poorman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Starting and stopping your tests

One of the unique features of the Salesforce1 platform is its governor limits. These limits are intended to keep you from writing inefficient code and, more importantly, ensure that no one org is using vast amounts of resources at the detriment of other org's. Having said that, they can often cause problems when writing tests. After all, if you're creating your own test data, and testing in bulk, you may very well run into the max DML or max query count limits. This is why Salesforce created the platform-unique startTest and stopTest methods. These methods do more than just delineating the portions of your test that exercise your code; they provide you with two invaluable services. First, calling startTest() will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required