public ApexPages.StandardSetController setActivityCon {
        get {
            System.debug('inside setActivityCon');
            //if the setActivityCon is created for the first time or if a new record is created then query from the child participant
            if(setActivityCon==null || setAct) {       

                String participantQuery = createQuery(interactionId);
                setActivityCon = new ApexPages.StandardSetController(Database.getQueryLocator(participantQuery));
                System.debug('setActivityCon :: ' + setActivityCon);
                System.debug('pageNumber  :: ' + pageNumber );
                setControllerBirthday = DateTime.now();

            return setActivityCon;
  • Please share the test class – Samir Feb 9 '17 at 7:43
  • i don't have any specific problem but i need to cover these line – user41664 Feb 9 '17 at 7:47
  • @user41664 why do you need test code to cover setActivityCon separately. Ideally it should be referred somewhere else in controller. So it should cover automatically. – Reshma Feb 9 '17 at 12:16

If You Need To Test ApexPages.StandardSetController Pass The Same Object Eg. Account Object

Account acc1 = new Account (Name = 'Account 1', Type = 'Type A');
insert acc1;

Then Call constructor with acc1 as parameter

ApexPages.StandardController sc = new ApexPages.standardController(acc1);

Ref Link: click And Click

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.