Skip to main content
Vivekh R a posé une question dans #Data Management
Class File:

 

How to write test class for this Future method.? need help

 

public class FutureMethods{    

 

@future   

 

public static void processLargeAccounts(Id AllTierID,Decimal TUDMin)

 

{        

 

List<TUDTiers__c> AllTierMin = [select Id,MinimumRange__c from TUDTiers__c where Id =: AllTierID];              

 

AllTierMin[0].MinimumRange__c=TUDMin+0.01;       

 

System.debug(AllTierMin[0]);       

 

TriggerUtility.isFutureUpdate = true;       

 

update AllTierMin;   

 

}

 

}

 

Class file:

 

public class TriggerUtility

 

{    

 

public static boolean isFutureUpdate;

 

}
7 réponses
  1. 14 janv. 2014, 11:24
    Hello,

     

    Test classes can be written in a same manner like we write for normal methods.

     

    Internally they are executed asynchronously.

     

    Please mark it as a best answer if it helps.
0/9000