Why would a developer use Test. startTest( ) and Test.stopTest( )? - ProProfs Discuss
Advertisement

Why would a developer use Test. startTest( ) and Test.stopTest( )?

Why would a developer use Test. startTest( ) and Test.stopTest( )?

Change Image    Delete



This question is part of Salesforce Platform Developer 1
Asked by Wyatt Williams, Last updated: Nov 27, 2020

+ Answer
Request
Question menu
Vote up Vote down

2 Answers

e.Ronald

e.Ronald

e.Ronald
E.Ronald

Answered Jan 03, 2018

When the test actually begins in a Salesforce account, that can be determined using the starttest method. This will noted in the test code. Everything listed in the test code before the start test is the part that needs to allow to you do the test. There are certain limitations that can occur during the start test and stop test methods.

Only two SOQL queries can be made between these two parts. The parts of the code that falls in between the starttest and stoptest is the new set of governor limits. When a user develops these two methods in the test code, they are doing this in order to create an additional set of governor limits. This would take place during the execution of a single test class.

upvote downvote
Reply 

John Smith

John Smith

John Smith
John Smith

Answered Apr 26, 2017

To create an additional set of governor limits during the execution of a single test class.

####
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.