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
AmphitriteAmphitrite 

Set controller extension testing - compile error

Error: Compile Error: Constructor not defined: [ApexPages.StandardSetController].<Constructor>(SOBJECT:Case) at line 13 column 39

 

Getting this error - not sure how to proceed.

 

 

@isTest

private class CaseBulkConfirmTest {

static testMethod void TestCaseBulkConfirm(){

PageReference pageRef = Page.CaseBulkConfirm;

Test.setCurrentPageReference(pageRef);

Case c = new case();

ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(c);

CaseBulkConfirm e = new CaseBulkConfirm(ssc);


String nextPage1 = e.ConfirmNext().getURL();
String nextPage2 = e.CancelClose().getURL();


System.assertEquals('apex/CaseBulkUpdate',nextPage1);
System.assertEquals('/500/o',nextPage2);

}
}

Best Answer chosen by Admin (Salesforce Developers) 
AmphitriteAmphitrite

Solution is that I needed to pass an array to the standardsetcontroller rather than a single record.