You need to sign in to do that
Don't have an account?
How to write test class
HI
I am getting this Error: Compile Error: Method does not exist or incorrect signature: [checkboxex123].setacctypes() at line 29 column 9
public class checkboxex123{
public list<string> acctypes=new list<string>();
boolean disable=true;
public list<selectoption> getitems(){
list<SelectOption> options=new list<SelectOption>();
//options.add(new SelectOption('Demat','Demat'));
//options.add(new SelectOption('savings','savings'));
return options;
}
public void setacctypes( list<string> acctypes){
this.acctypes=acctypes;
}
public list<string> getacctypes(){
return acctypes;
}
public PageReference test() {
return null;
}
private static testmethod void testclass()
{
checkboxex123 con=new checkboxex123();
con.getacctypes();
con.test();
con.getitems();
con.setacctypes( );
}
}
argument to method was not correct. infact ther was no argument at all.
try this in test method:
private static testmethod void testclass()
{
checkboxex123 con=new checkboxex123();
con.getacctypes();
con.test();
con.getitems();
list <string> testtypes= new list <string>();
testtypes.add('test1');
testtypes.add('test2');
con.setacctypes(testtypes );
}
All Answers
argument to method was not correct. infact ther was no argument at all.
try this in test method:
private static testmethod void testclass()
{
checkboxex123 con=new checkboxex123();
con.getacctypes();
con.test();
con.getitems();
list <string> testtypes= new list <string>();
testtypes.add('test1');
testtypes.add('test2');
con.setacctypes(testtypes );
}
Thank you Big V.