Setting the created date of a record using a system method can be a valid scenario for execution by unit tests, depending on the context and requirements of your system.
If you have a method or function responsible for setting the created date of a record, you can write unit tests to verify its correctness. This can involve creating a record, calling the method, and then asserting that the created date of the record has been set correctly.
Hi Saravana Ravikumar,
Setting the created date of a record using a system method can be a valid scenario for execution by unit tests, depending on the context and requirements of your system.
If you have a method or function responsible for setting the created date of a record, you can write unit tests to verify its correctness. This can involve creating a record, calling the method, and then asserting that the created date of the record has been set correctly.
For more details, you can also refer to this Salesforce Documentation (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_test.htm#apex_System_Test_setCreatedDate)
If this helps, please mark it as the best answer.
Thanks
Arun