I created a controller which looks like this
public with sharing class EventRegistrationController {
// A CONTROLLER FUNCTION
// FUNCTION RETURNS A LIST OF cSession
public List<cSession> getSessions() {
//DO STUFF
}
//A PUBLIC CLASS WITHIN CONTROLLER
@TestVisible public class cSession
{
public Session__c con {get; set;}
public Boolean selected {get; set;}
//This is the contructor method.
public cSession(Session__c c) {
con = c;
selected = false;
}
}
}
I need to write a test code for the controller, how can I create a list of cSession
and call getSession
function?