You need to sign in to do that
Don't have an account?

Test Methods
What is the need of Test.start() and Test.stop() methods,without using these methods what issue i will get?
Thanks,
SFDC_Learner
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
What is the need of Test.start() and Test.stop() methods,without using these methods what issue i will get?
Thanks,
SFDC_Learner
Test.start() takes you into a new context. When you setup a load of test data, execute SOQL calls against that data to extract ids etc, you will consume some of the limits for DML, SOQL etc. By executing Test.startTest() you effectively reset all those limits so that your test code starts from scratch. This allows you to be sure that any governor limits problems are entirely down to your code.
Test.stopTest() takes you back to the original context, but more importantly causes all asynchronous processing scheduled by your test to execute. So if you have @future calls to test and you don't execute this method then they won't run.