You need to sign in to do that
Don't have an account?
Error in my test class
Hi
I am trying to write a test class for the following controller. Here is my 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 the test class i wrote and this the error it is throwing Error: Compile Error: line breaks not allowed in string literals at line 8 column -1. I mentioned the line 8 in Red
Remove the line break and make those two lines one. Sometime I have to copy the code into notepad and copy it back in. HIdden characters sometimes get added if your copied and pasted from a third party application (word, IE, FF, etc).
Good Luck
Mike
Looks like you missed a quote for this value:
Off_Net_Circuit_Expense_Total__c='$1000.00,
replace this with below line
Off_Net_Circuit_Expense_Total__c='$1000.00',
Thanks
Vinay Marru