Activity Forums Salesforce® Discussions what is the solution for this error(Method does not exist or incorrect signature: void StartTest() from the type test) in Salesforce?

  • what is the solution for this error(Method does not exist or incorrect signature: void StartTest() from the type test) in Salesforce?

    Posted by Shubham on January 21, 2020 at 8:54 am

    i am experiencing this error (Method does not exist or incorrect signature: void StartTest() from the type test) in the asynchronous trail's future method unit..

    here's my code

    @isTest
    public class AccountProcessorTest {
    public static testmethod void AccountProcessorTest1(){
    Account testaccount = new Account();
    testaccount.name = 'Test Account';
    insert testaccount;

    Contact testcontact = new Contact();
    testcontact.FirstName = 'Chief';
    testcontact.LastName = 'Hopper';
    testcontact.AccountId = testaccount.Id;
    insert testcontact;

    set<Id> AccId = new set<Id>();
    AccId.add(testaccount.Id);

    Test.StartTest();
    AccountProcessor.countContacts(AccId);
    Test.StopTest();
    Account ACC = [select Number_of_Contacts__c from Account where id = :testaccount.Id LIMIT 1];
    System.assertEquals ( Integer.valueOf(ACC.Number_of_Contacts__c) ,1);
    }

    }

    Can anyone help me on how to tackle this error

    • This discussion was modified 4 years, 10 months ago by  Shubham.
    Shubham replied 4 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Popular Salesforce Infographics