You need to sign in to do that
Don't have an account?
anuj pathak 2
Test Classs with Last modified Date
Hi Team,
I need to create a account that's have lastmodified date in prevous months, but LastModified field is non writable. so how i can cover my test class.
I need to create a account that's have lastmodified date in prevous months, but LastModified field is non writable. so how i can cover my test class.
You need to use static resources. please follow below example
Test.loadData Example
The following are steps for creating a sample .csv file and a static resource, and calling Test.loadData to insert the test records.
Create a .csv file that has the data for the test records. This sample .csv file has three account records. You can use this sample content to create your .csv file.
Create a static resource for the .csv file:
From Setup, enter Static Resources in the Quick Find box, then select Static Resources.
Click New.
Name your static resource testAccounts.
Choose the file you created.
Click Save.
Call Test.loadData in a test method to populate the test accounts.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh