function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Garrett SamuelsGarrett Samuels 

How do i fix error?

User-added image
Best Answer chosen by Garrett Samuels
Neetu_BansalNeetu_Bansal
Hi Garrett,

Use annotation @isTest before the class like:
@isTest
private class CaseAutoCreateContactTest
{
//Rest of the code
}

Thanks,
Neetu

All Answers

Neetu_BansalNeetu_Bansal
Hi Garrett,

Use annotation @isTest before the class like:
@isTest
private class CaseAutoCreateContactTest
{
//Rest of the code
}

Thanks,
Neetu
This was selected as the best answer
William TranWilliam Tran
Be sure to include @isTest

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
Sanju Rana 5Sanju Rana 5
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.