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, 2 months ago by  Shubham.
    Shubham replied 4 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Free 5 Day Salesforce Challenge!

Video in

To access the signup form head over to www.talentstacker.com/Salesforce TalentStacker Podcast Salesforce Episode: https://talentstacker.libsyn.com/how-to-earn-60k-100k-a-year-within-6-months-without-a-college-degree-say-what-salesforce-career-development-path-with-bradley-rice Do you already have a job as a Salesforce Professional and…

Popular Salesforce Infographics