Test Methods are static because you do not call the test methods explicitly when you run a class for execution.
When you run your apex tests these methods needs to be executed whether they are called or not which is why we make them static so they can be run while the class excecutes.
A static method doesn’t require an instance of the class in order to run. They’re created with every object instantiated from the class in which they’re declared.
Test Methods are static because you do not call the test methods explicitly when you run a class for execution.
When you run your apex tests these methods needs to be executed whether they are called or not which is why we make them static so they can be run while the class excecutes.
A static method doesn’t require an instance of the class in order to run. They’re created with every object instantiated from the class in which they’re declared.
Test Methods are static because you do not call the test methods explicitly when you run a class for execution.
When you run your apex tests these methods needs to be executed whether they are called or not which is why we make them static so they can be run while the class excecutes.
A static method doesn’t require an instance of the class in order to run. They’re created with every object instantiated from the class in which they’re declared.
Mark as solved if this helps.
Regards
Medhya Mahajan
All Answers
Test Methods are static because you do not call the test methods explicitly when you run a class for execution.
When you run your apex tests these methods needs to be executed whether they are called or not which is why we make them static so they can be run while the class excecutes.
A static method doesn’t require an instance of the class in order to run. They’re created with every object instantiated from the class in which they’re declared.
Mark as solved if this helps.
Regards
Medhya Mahajan