The perfect choice of one-stop service for diversification of architecture.
e. private, you should specify it as such with the keyword private and you can use the @TestVisible annotation as suggested. However this should be a last resort!Before you do that however, you should do the following:If you cannot find a way to populate your private properties, after you have exhausted all options, then you can use the @TestVisible annotation.Here would be an example:
Can any one help me on this Error as **Variable is not visible** in a test class.Any help very much appreciated.
Code : public with sharing class InvoiceController List
Test Class :
InvoiceController icwc new InvoiceController(sc); icwc.appointmentListicwc.getappointmentList(); icwc.appointmentList1icwc.getappointmentList1();
The system throws an Error as :
Variable is not visible: appointmentList icwc.appointmentListicwc.getappointmentList();
Similarly for the other
Variable is not visible: appointmentList1 icwc.appointmentList1icwc.getappointmentList1();
·OTHER ANSWER:
Can any one help me on this Error as **Variable is not visible** in a test class.Any help very much appreciated.
Code : public with sharing class InvoiceController List
Test Class :
InvoiceController icwc new InvoiceController(sc); icwc.appointmentListicwc.getappointmentList(); icwc.appointmentList1icwc.getappointmentList1();
The system throws an Error as :
Variable is not visible: appointmentList icwc.appointmentListicwc.getappointmentList();
Similarly for the other
Variable is not visible: appointmentList1 icwc.appointmentList1icwc.getappointmentList1();