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

Structuring unit tests

In general, there is only one overarching pattern for unit testing code on the Salesforce1 platform. The essential differences between the Salesforce1 platform and other software development stacks does make unit testing is a bit different. That said, if you're familiar with unit testing in other languages, this will largely seem familiar to you. Here's the general pattern:

Structuring unit tests

Using your own data

Each of our test methods needs to create its own test data. While this seems cumbersome and time consuming, it's the only safe way to run unit tests. Relying on existing data in your org is problematic because you cannot ensure that the ...

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