2 Antworten
Hi Ahmed,ANS: Static Resources.Loading Test Data :Using the Test.loadData method, you can populate data in your test methods without having to write many lines of code. Follow these steps:
- Add the data in a .csv file.
- Create a static resource for this file.
- Call Test.loadData within your test method and passing it the sObject type token and the static resource name.
List<sObject> ls = Test.loadData(Account.sObjectType, 'myResource');
More info : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_load_data.htmHope this helps you!If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.Salesforce Freelance Consultant/Developer/Administrator/Trainer@For Salesforce Project Support: salesforcestart1@gmail.comSalesforce latest interview questions and training videos :https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1Thanks,
V Varaprasad
Email: salesforcestart1@gmail.com