You need to sign in to do that
Don't have an account?
Manisha Goparaju
A developer wants multiple test classes to use the same set of test data.
Hi I am preparing for Saleforce Developer certification (PD-01) , I came acroos the below question.
A developer wants multiple test classes to use the same set of test data?
As per my kowledge , answer should be 'create set up method for each test class'
But in dump paper, it says, "use seealldata==true annotaton in the test class"
i am not getting how it works, please explain.
Also please share dumps if u have
A developer wants multiple test classes to use the same set of test data?
As per my kowledge , answer should be 'create set up method for each test class'
But in dump paper, it says, "use seealldata==true annotaton in the test class"
i am not getting how it works, please explain.
Also please share dumps if u have
You can use the @isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization. The access includes pre-existing data that the test didn’t create.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Sachin Arora
www.sachinsf.com
All Answers
You can use the @isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization. The access includes pre-existing data that the test didn’t create.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Sachin Arora
www.sachinsf.com
for reference. - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_utility_classes.htm
The correct answer is creating Test Utility Class and referencing that in test class. Test utility classes are the one which are used for test Data creation and contain methods which are always public/global so that can be used by another test class.