Find your content:

Search form

You are here

Questions related to the design and development or any other area of unit tests should be tagged with the unit-test tag. Unit tests typically require

 
Share

Questions related to the design and development or any other area of unit tests should be tagged with the unit-test tag.

Unit tests typically require setting up data on which the code under test operates. As of API version 24 (Spring '12) unit test methods do not have access to the organization's data by default, with the exception of setup and metadata objects. However, the organization's data can still be accessed by explicitly indicating that intent by using the @isTest(SeeAllData=true) annotation.

Once the data is set up the unit of code under test is executed and then typically System.assert assertions about the results of the execution are made.

To learn more about unit tests in Salesforce see the following.


Attribution to: Peter Knolle
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/697

My Block Status

My Block Content