You need to sign in to do that
Don't have an account?

Testing for Custom Controller
Hi there,
Wrote a custom controller to display an overall view of all our services, but the test method is returning a "System.NullPointerException: Attempt to de-reference a null object" on this line:
@IsTest(SeeAllData=true) public static void testServiceTimeline() { ServiceTimeline controller = new ServiceTimeline(); }
This is my controller:
public class ServiceTimeline { public List<ServiceTime> serviceList { get; set; } public ServiceTimeline() { List<Service__c> ListOfServices= [ SELECT Name, RecordType.Name, Address_Single_Line__c, Status__c, CreatedDate, Stage_Prospect__c, Stage_Site_Survey__c, Stage_Scheduling_Install__c, Stage_Provisioning__c, Stage_Pending_Billing__c, Stage_Order_Received__c, Stage_Order_Completion__c, Stage_Obtaining_Install_Approval__c, Stage_Awaiting_Install__c, Stage_Design_Request__c FROM Service__c WHERE Status__c NOT IN ('Order Completion', 'Cancelled', 'Stalled', 'Unserviceable') AND RecordType.Name NOT IN ('Prospect','Ethernet Interconnect') ]; if (ListOfServices.size() > 0) { for (Service__c tempService : ListOfServices) { serviceList.add(new ServiceTime(tempService)); } } else { Util.addERRORMessage('No Services are currently being installed.'); } } }
Any help would be appreciated.
All Answers
Cheers!