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
Alan FloresAlan Flores 

Help with test class "Method does not exist or incorrect signature"

Dear All:

I create a test class with Test Generator APP help, but I got some issues. Mainly, the code left me what I assume were junk characters, I tried to fix them but now I got Error: Compile Error: Method does not exist or incorrect signature: void ClientAccountSummary(List<CP_AccountSummary.ClientAccountSummary>) from the type CP_PieChartHelper at line 9 column 23.

Can you help me to figure out what's wrong? I'm very new in Test Classes. There is the code:
 
@isTest
 
private class CP_PieChartHelper_Test{
 
  static testMethod void test_ClientAccountSummary_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    CP_PieChartHelper.ClientAccountSummary (new List<CP_AccountSummary.ClientAccountSummary>());
 
  }
 
  static testMethod void test_AssetSummary_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    CP_PieChartHelper.AssetSummary (new List<CP_AccountSummary.AssetSummary>());
 
  }
 
  static testMethod void test_ApproachSummary_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    CP_PieChartHelper.ApproachSummary (new List<CP_AccountSummary.ApproachSummary>());
 
  }
 
  static testMethod void test_getAllPieChartsData_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    CP_PieChartHelper.getAllPieChartsData(new CP_ClientSummary(),new CP_AccountSummary());
 
  }
 
}

 
Best Answer chosen by Alan Flores
Glyn Anderson 3Glyn Anderson 3
Alan,  Is the "ClientAccountSummary" method a static method?  If not, the test method will have to use the instance of the CP_PieChartHelper class that it created:

<pre>
static testMethod void test_ClientAccountSummary_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    obj01.ClientAccountSummary (newList<CP_AccountSummary.ClientAccountSummary>());
 
}
</pre>

All Answers

Glyn Anderson 3Glyn Anderson 3
Alan,  Is the "ClientAccountSummary" method a static method?  If not, the test method will have to use the instance of the CP_PieChartHelper class that it created:

<pre>
static testMethod void test_ClientAccountSummary_UseCase1(){
 
    CP_PieChartHelper obj01 = new CP_PieChartHelper();
 
    obj01.ClientAccountSummary (newList<CP_AccountSummary.ClientAccountSummary>());
 
}
</pre>
This was selected as the best answer
Amit Chaudhary 8Amit Chaudhary 8
Can you please post code of CP_PieChartHelper class.
Glyn Anderson 3Glyn Anderson 3
Alan,  Are you still having trouble with this?  Did my suggestion help, or did you find another way to solve the problem.  Please mark the question as solved.  You can post your own solution - we'd all be interested to know how you fixed it.  Thanks!
Alan FloresAlan Flores
Your suggestion worked, thanks a lot!