You need to sign in to do that
Don't have an account?
roni shore
cover boolean variable in test calss
Public Class Customer_Controller{
ApexPages.StandardController controller;
@TestVisible private final Case thisCase;
public Customer_Controller(ApexPages.StandardController controller) {
this.controller = controller;
this.thisCase = (Case)controller.getRecord();
}
public Boolean isTScase {
get {
return (((String)thisCase.RecordTypeId).left(15) == Label.Caseod_RecordType);
}
}
public Boolean isCScase {
get {
return (((String)thisCase.RecordTypeId).left(15) == Label.Casenew_recordtype);
}
}
error : Compile Error: Variable is not visible:
ApexPages.StandardController controller;
@TestVisible private final Case thisCase;
public Customer_Controller(ApexPages.StandardController controller) {
this.controller = controller;
this.thisCase = (Case)controller.getRecord();
}
public Boolean isTScase {
get {
return (((String)thisCase.RecordTypeId).left(15) == Label.Caseod_RecordType);
}
}
public Boolean isCScase {
get {
return (((String)thisCase.RecordTypeId).left(15) == Label.Casenew_recordtype);
}
}
error : Compile Error: Variable is not visible:
All Answers
Please make sure you are reference your method using an object of controller class, not by the name(because your class method is not static).
Reference it like this:
Customer_Controller obj= new Customer_Controller();
Boolean Flag= obj.isTScase;
Thanks!