• Patrick Lawson
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
@isTest 

private class ListViewControllerTest {
    /**This is the list which will be passed to Visualforce Page and in turn passed to Flow from Visualforce**/
    public List<Matching_Facility__c> LstSelectedFacilities { get; set; }
    
  

    public ListViewControllerTest(ApexPages.StandardSetController listcontroller) {
      
        Set<Id> facilitySelectedIds = new Set<Id>();
        LstSelectedFacilities = new List<Matching_Facility__c>();
            
        for (Matching_Facility__c f : (Matching_Facility__c[])listcontroller.getSelected()) {
            facilitySelectedIds.add(f.Id);
        }

        /**Querying on the Selected records and fetching fields which are required in Flow **/
        LstSelectedFacilities = [SELECT Id,  Client_Search__c FROM Matching_Facility__c WHERE Id IN :facilitySelectedIds];
    }
}

Need code coverage to depoy, but cannot test.