• Raviteja Vaddi 9
  • NEWBIE
  • 0 Points
  • Member since 2015

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

I wrote a test method to cover code for the class shown below.

But its not covering the wrapper class .

please direct me to test wrapper class.

 

public with sharing class sno_in_table
{

public list<wrap> getRecords()

{
integer sno=1;
list<wrap>emps=new list<wrap>();
list<employee__c>emp_records=[select name,phone__c from employee__c];

for(employee__c em:emp_records)
{

emps.add(new wrap(sno,em));
sno++;

}
return emps;
}

 

//wrapper class

 

public class wrap
{
public integer sno{get;set;}
public employee__c emp{get;set;}

public wrap(integer sn, employee__c e)
{
emp=e;
sno=sn;
}

}

public static testmethod void m1()
{
sno_in_table sno=new sno_in_table();
sno.getrecords();
}
}