+ Start a Discussion
Akshay MhetreAkshay Mhetre 

Help me to cover this (test) class...YB_RCUReportWrapper is already covered with 95%

public class YB_RCUReportVFController {
    
     public Id caseId;
     public YB_RCUReportWrapper rcuReportData{get;set;}
    
      public YB_RCUReportVFController()
    {
        this.caseId = Apexpages.currentpage().getparameters().get('id');
        this.rcuReportData = new YB_RCUReportWrapper(this.caseId);
        
        
    }

}
PradeepgorePradeepgore
Hi Akshay,

When you mention .YB_RCUReportWrapper is covered 95%, I am assuming the test class doesn't lines in bold

public class YB_RCUReportVFController {
     public Id caseId;
     public YB_RCUReportWrapper rcuReportData{get;set;}
      public YB_RCUReportVFController()
    {
        this.caseId = Apexpages.currentpage().getparameters().get('id');
        this.rcuReportData = new YB_RCUReportWrapper(this.caseId);
    }
}

Test Class Snippet:

Case YourCaseRecord = new Case();
 //Initialize your values here
 insert YourCaseRecord;

Test.StartTest(); 

  PageReference pageRef = Page.MentionYourPageName; // Add your VF page Name here
  pageRef.getParameters().put('id', String.valueOf(YourCaseRecord.Id));
  Test.setCurrentPage(pageRef);


YB_RCUReportWrapper testYB_RCUReportWrapper= new YB_RCUReportWrapper();
//Initialize the values with testYB_RCUReportWrapper
'
YB_RCUReportVFController obj= new YB_RCUReportVFController();
obj.rcuReportData= testYB_RCUReportWrapper; // to cover wrapper getter setter
  //Call controller functions here
  ..
  ..
Test.StopTest();

Henceforth, please mention the lines/screenshot of the coverage. Let us know if it resolves your issue.
Like when your issue is solved. This will give motivation to answer more.

-Pradeep Gore

 
John James 22John James 22
Help me to cover this (test) class...YB_RCUReportWrapper is already covered with 95% · public Id caseId; public YB_RCUReportWrapper rcuReportData https://youarewhatyoudrink.org/springwell-water-filter-reviews/