function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vinod TomarVinod Tomar 

Help needed to write Test Class for event and eventattendee object

Hi I have written the below code to fufill some requirement. Can you hele me to write Test class for this code. Please keep in mind that we can not create eventattendee records using API

 

public with sharing class ctlr_participants {

private string eventid {get; set;}

public ctlr_participants (ApexPages.StandardController eventcontroller) {
this.eventid = eventcontroller.getId();


}

public List<EventAttendee> getparticipants(){

system.debug('eventID'+ this.eventid);
string str = this.eventid;
List<EventAttendee> participants = new List<EventAttendee>();
system.debug(str);
participants = [select AttendeeId from EventAttendee where eventid =: str ];
system.debug('count of attendee'+ eventparticipants.SIZE());
return participants ;
}

}