0% found this document useful (0 votes)
7 views

@TestSetup Method

The @testSetup method can only be used once per class, will execute first, and if a DML error occurs the rest of the tests will not run; calling non-test methods from @testSetup does not provide code coverage for those methods.

Uploaded by

aniket som
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

@TestSetup Method

The @testSetup method can only be used once per class, will execute first, and if a DML error occurs the rest of the tests will not run; calling non-test methods from @testSetup does not provide code coverage for those methods.

Uploaded by

aniket som
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Thinks to remember when you use @testSetup method

1. We can use only one test setup method per class.


2. Test setup method will execute first in the test class.
3. If any DML error occurs in this test setup method, rest of the method not
executed.
4. If a test setup method calls a non-test method of another class, no code
coverage is calculated for the non-test method.

You might also like