
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 answers
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.