[SalesForce] how to access static method in test class

Controller Name : Rforce_TaskUtils_CLS

My controller has a method as

public static void onAfterInsert(list <Task> listtask, boolean isInsert, Map <Id, Task> oldMap )

In my test clas, I have tried to access the above method as

Rforce_TaskUtils_CLS.onAfterInsert(List <Task> listtask, boolean isInsert, Map <Id, Task> oldMap);

It shows error like :

unexpected token: 'List' at line 13 column 38

How to resolve this?

Complete test class code is :

 @isTest
 public class TaskTriggerHandlerforRforce_Test { 

   public static testMethod void aftIns()
   {
      Rforce_TaskUtils_CLS.onAfterInsert(List <Task> listtask, boolean isInsert, Map <Id, Task> oldMap);
   }
 }

Best Answer

Why are You Defining objects again whhile calling the class.

Try putting objects in the parameter while calling.

public static List listtask ; public static boolean firstRun ; public static Map oldMap ; Rforce_TaskUtils_CLS.onAfterInsert(listtask,isInsert,oldMap);

Related Topic