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
SwayampravaSwayamprava 

test class for wrapper class very urgent

Please Help me on this ASAP.

 

public class NewRelationship_controller{

public class De_Re_St_DC{------------------------------This is my wrapper class name,But my test method is 
public Boolean isSelected {get;set;}--not covering this class  so not able to cover any other line.
public Strategy__c Strategy {get;set;}
public Decision__c Decision {get;set;}
public RACI__c RACI {get;set;}
public Relationship__c Relation {get;set;}
public User userR {get;set;}
public Account Acc {get;set;}
public Contact con {get;set;}
}



public List<De_Re_St_DC> D_R_S_D{get;set;}
public List<De_Re_St_DC> D_R_S_D_Selected{get;set;}

public Id I = ApexPages.CurrentPage().getParameters().get('id');
public String RecID=I;
public String ObjID=RecID.subString(0,3);

public string searchText {get;set;}
public List<Decision__c> searchDResults {get;set;}
public List<Strategy__c> searchSResults {get;set;}
public List<Raci__c> searchRResults {get;set;}
public List<User> searchUResults {get;set;}
public List<Account> searchAResults {get;set;}
public List<Contact> searchCResults {get;set;}


public Decision__c allDesicion=new decision__c();



public Set<String> selDecisionNames {get;set;}
public Set<String> SelectIds {get;set;}
public Boolean hasSelDecision {get;set;}
public List<Relationship__c> relList1{get;set;}

public String DecID='a06';
public String StrID='a0G';
public String DecColID='a07';
public String UserIDs='005';
public String AccIDs='001';
public String ConIds='003';

public NewRelationship_controller(ApexPages.StandardSetController controller) {}
public NewRelationship_controller(ApexPages.StandardController controller) {}





public Relationship__c r{get;set;}

public NewRelationship_controller(){


r=new Relationship__c();
relList1= new List<Relationship__c>();




D_R_S_D=new List<De_Re_St_DC>();
D_R_S_D_Selected=new List<De_Re_St_DC>();

}




public void displayselected(){

//D_R_S_D_Selected.clear();
for(De_Re_St_DC Obj: D_R_S_D)
if(Obj.isSelected == true)
D_R_S_D_Selected.add(Obj);

}

 

-----------------------------There are more lines of code. 

}

 

 

In my Test class if i Write   -------De_Re_St_DC dr =new De_Re_St_DC();

the getting Error: Compile Error: Invalid type: De_Re_St_DC at line 393 column 26

 

 


Rajesh SriramuluRajesh Sriramulu

Hi

 

 

if u want to create a object for De_Re_St_DC means we can write like this 

 

NewRelationship_controller.De_Re_St_DC  drsd = new NewRelationship_controller.De_Re_St_DC ()

 

with this object u can have the methods and variables so that every line will cover

 

Regards

SRS