You need to sign in to do that
Don't have an account?
Abhilash Daslal
Test class for the following controller class
Hi Guys,
Please give the test class for the following test class
public class ClsAccountController{
public contact con{get; set;}
public List<Account> AccountList{get; set;}
public Account acc{get;set;}
public id conID{get; set;}
public ClsAccountController(){
}
public List<Account> getConttacts(){
conID=ApexPages.currentPage().getParameters().get('id');
AccountList=new List<Account>();
AccountList=[Select Id,Name,Phone from Account where Contact=:conID];
return AccountList;
}
}
Thanks in advance,
Abhilash
Please give the test class for the following test class
public class ClsAccountController{
public contact con{get; set;}
public List<Account> AccountList{get; set;}
public Account acc{get;set;}
public id conID{get; set;}
public ClsAccountController(){
}
public List<Account> getConttacts(){
conID=ApexPages.currentPage().getParameters().get('id');
AccountList=new List<Account>();
AccountList=[Select Id,Name,Phone from Account where Contact=:conID];
return AccountList;
}
}
Thanks in advance,
Abhilash
All Answers
Thanks for your reply.I was wondering if custom objects were used instead of Standard objects.SUppose my custom objetcs are myCustomObject1__c and myCustomObject2__c instead of Account and contact.How will my code change
How can can i write cls.getConttacts();
Will it be cls.getmyCustomObject1__c???
Thanks,
Abhilash
I meant
ClsAccountController cls = new ClsAccountController(); cls.getConttacts();
cls.getConttacts();
In the above,I want to know if cls.getmyObject__c is possible if i had used custom object??