Skip to main content

Posts

Showing posts from December, 2014

Set Up Test Data for an Entire Test Class - Spring15

You can reduce test execution times especially when you’re working with many records. Test setup (@testSetup) methods enable you to create common test data easily and efficiently. By setting up records once for the class, you don’t need to re-create records for each test method. If a test class contains a test setup method, the testing framework executes  the test setup method first, before any test method in the class. Records that are created in a test setup method are available to all test methods in the test class and are rolled back at the end of test class execution.