You need to sign in to do that
Don't have an account?
renaiah anamalla 7
Why we are using Seealldata=true in test cases,
Why we are using Seealldata=true in test cases,
Why we are using Private in test cases.
Why we are using Private in test cases.
Following links u can refer:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_isTest.htm
http://www.laceysnr.com/seealldata-why-i-think-you-shouldnt-use/
Let me know if it helps.
Class is defined using the @isTest annotation can only contain test methods. One advantage of creating a separate class for testing, it don't count against your organization limit of 3 MB for all Apex code.
@istest(seealldata=true)
In test class and methods, we can access data in the organization. Prior to it we can just access test data. Using this we can access organization data. For Apex code saved using Salesforce.com API version 24.0 and later, use the isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization, including pre-existing data that the test didn’t create.
Starting with Apex code saved using Salesforce.com API version 24.0, test methods don’t have access by default to pre-existing data in the organization. However, test code saved against Salesforce.com API version 23.0 or earlier continues to have access to all data in the organization and its data access is unchanged.
Always try to avoid use SeeAllData= true because in that case your test class depend on your sandbox data. You May get some issue will deployment.