0
public SynonymsDictionary_cls{
  public SynonymsDictionary_cls(ApexPages.StandardController stdcontroller) {

    //some logic
  }
  public PageReference importNoiseData(){
    return Page.samplepage;
  }
}

Hi,I am able to create instance of this class,can u please suggest,how can call this standard controller constructor in test class,thanks in advance.Ineed to cover that pagereference method.

1 Answer 1

4

First you need to create a standard controller instance and then your class instance

ApexPages.StandardController stdcontroller = new ApexPages.StandardController(ObjInstance); //here ObjInstance is the object instance in which you are using this standard controller

SynonymsDictionary_cls ss = new SynonymsDictionary_cls(stdcontroller );

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .