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
Aryan JhaAryan Jha 

Method does not exist or incorrect signature: void startTest() from the type test

@isTest
public class AddPrimaryContactTest {
@testSetup 
    static void setup() {
        List<Account> accounts = new List<Account>();
        // add 50 NY account
        for (Integer i = 0; i < 50; i++) {
        accounts.add(new Account(Name='NY'+i, billingstate='NY'));
        }
         // add 50 CA account
        for (Integer j = 0; j < 50; j++) {
        accounts.add(new Account(Name='CA'+j, billingstate='CA'));
           }
        insert accounts;
      }
       static testmethod void testQueueable(){
        contact a=new contact(Lastname='mary', Firstname='rose'); 
        Test.startTest();        
        AddPrimaryContact updater=new AddPrimaryContact(a, 'CA');
        System.enqueueJob(updater);
        Test.stopTest(); 
      
        System.assertEquals(50, [SELECT count() FROM Contact WHERE Lastname='mary' AND Firstname='rose']) ;                      
    }   
}
AbhishekAbhishek (Salesforce Developers) 
There is a good chance you actually created a class somewhere called Test. Find it and delete it.


For further reference check this,

https://salesforce.stackexchange.com/questions/160299/test-class-throwing-error-method-does-not-exist-or-incorrect-signature


If it helps you and closes your query by marking it as solved so that it can help others in the future.


Thanks.