0

I was wondering if you could help me. I am strugging to create a test class for the code below. Any help would be appreciated.

Many thanks

public class ITCheckList  {

public List<Match_Day_Check_List__c> getITCheckList(){

return [SELECT Handshake_Event_Setup__c, Access_Manager_Checks__c, Wifi_Setup__c, Ground_Catering_Till_Checks__c, Poll_Steward_System__c, Turnstile_Checks__c, 
                Press_Wifi_Checks__c, Set_Phone_Times_Fan_Centre__c, Check_Sodexo_Epos_Servers__c, IT_Systems_Readiness_PC__c, HR_Readiness_Percent__c, Stadium_Readiness_PC_1__c, 
                Steward_Comms_Checks_Complete_PC__c, Overall_Completion_Matchday__c,Lighting_to_all_areas_of_Sports_Ground__c, Fire_Alarm_System__c, Public_Address_System__c, CCTV_System__c,
                 Internal_External_Phone_System__c, Turnstile_Control_Counting_System__c, Door_Holding_Mechanism_System__c, Entry_Signage_Changed__c, H_S_Assessment_of_Broadcaster_Operation__c,
                 Set_Heating_Air_Con_in_Lounges__c, First_Aid_Room_Check__c FROM Match_Day_Check_LIst__c
                WHERE Name = 'Everton V West Ham United Goodison Park EPL 2013-05-12'];
    }
}
Andrew Hoban
  • 5
  • 2
  • 6

1 Answers1

0

Since this is a simple class, I assume any difficulty you are having comes from not populating the data in your test. Even though you have a record in your organization with that name, when your tests run the database will be blank. You can solve this in two ways:

  1. Use @isTest(SeeAllData=true) so your tests can see the data in your org. I do not recommend this method because it can make deployment difficult and make your tests unreliable.
  2. Properly create a Match_Day_Check_List__c record with the name = 'Everton V West Ham United Goodison Park EPL 2013-05-12' in your test class.
Kyle Olson
  • 36
  • 1