As a common practice, if your question is answered, please choose 1 best answer. But you can give every answer a thumb up if that answer is helpful to you.
Starting in Summer ‘13, test methods can be defined only in test classes (classes annotated with @isTest). You can no longer add a test method in a non-test class. This change applies to new Apex code saved using Salesforce.com API version 28.0 and later. Apex code saved using earlier API versions isn’t affected.
Use annotation @isTest before the class like:
Thanks,
Neetu
All Answers
Use annotation @isTest before the class like:
Thanks,
Neetu
like:
@isTest
private class HelloWorldTestClass {...
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks