You need to sign in to do that
Don't have an account?
Test class
Hi I am bit confused in writting a test class for a controller. I called these controller in an component. Please help me out in writing a Test class for the following controller
public class CAFApprovalHistoryController {
public String cafId {get;set;}
public List<ProcessInstanceHistory> getApprovalSteps() {
If (cafId != null) {
CAF__c cafs = [Select Id, Name, CAPEX_Total__c, Off_Net_Circuit_Expense_Total__c, CAF_IRR__c, of_Revisions__c, Sales_Rep__c, Sales_Manager__c, Account__c, CAF_Title1_del__c, CAF_1__c, Products_Requested__c, Bandwidth__c, Notes_of_Consideration__c, CAF_Link__c, (Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending, IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc) from CAF__c where Id = :cafId];
return cafs.ProcessSteps;
}
return new List<ProcessInstanceHistory> ();
}
}
Here is my component
try this