You need to sign in to do that
Don't have an account?

I want test class for below wrapper class
Hi,
i want test class for below wrapper class
public class Accountwrapper {
// variable
public list<acwrap> Acclist{get;set;}
public list<Account> selectlist{get;set;}
// Contructor
public Accountwrapper(){
Acclist=new list<acwrap>();
for(Account a:[select id,name,AccountNumber from Account]){
Acclist.add(new acwrap(a));
}
}
// Method
public void selected(){
selectlist=new list<Account>();
for(acwrap a1:Acclist){
if(a1.ischeck==true){
selectlist.add(a1.acc) ;
}
}
}
public class acwrap{
public Account acc{get;set;}
public boolean ischeck{get;set;}
public acwrap(Account ac){
this.acc=ac;
ischeck=false;
}
}
}
i want test class for below wrapper class
public class Accountwrapper {
// variable
public list<acwrap> Acclist{get;set;}
public list<Account> selectlist{get;set;}
// Contructor
public Accountwrapper(){
Acclist=new list<acwrap>();
for(Account a:[select id,name,AccountNumber from Account]){
Acclist.add(new acwrap(a));
}
}
// Method
public void selected(){
selectlist=new list<Account>();
for(acwrap a1:Acclist){
if(a1.ischeck==true){
selectlist.add(a1.acc) ;
}
}
}
public class acwrap{
public Account acc{get;set;}
public boolean ischeck{get;set;}
public acwrap(Account ac){
this.acc=ac;
ischeck=false;
}
}
}
You can try the following test class it covers 93% code coverage and also the wrapper class
Hope this helps you.
Regards,
Suraj