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

How can the following error this problem
hai guys,
when i am writing the test class controller it is getting following errors
controller
---------------------------
public class Advanced_Dashboard1 {
public list<Case> getCase1() {
return [select Status,Subject from case where contact.name = 'Smith' and Status != 'Closed' limit 5];
}
public string getContactname() {
return 'Smith';
}
}
testclass
------------------------
@isTest
public class Test_Advanced_Dashboard1
{
//calling controller class into the test class
Advanced_Dashboard1 ad = new Advanced_Dashboard1();
list<case> caselist = [select Status,Subject from case where contact.name = 'Smith' and Status != 'Closed' limit 5];
//calling methods into the testclass
ad.getCase1();
ad.getContactname();
}
when i saving the test testclass following error is occuring
Method must define a body
i did not why it is coming .please help me slove this problem.
when i am writing the test class controller it is getting following errors
controller
---------------------------
public class Advanced_Dashboard1 {
public list<Case> getCase1() {
return [select Status,Subject from case where contact.name = 'Smith' and Status != 'Closed' limit 5];
}
public string getContactname() {
return 'Smith';
}
}
testclass
------------------------
@isTest
public class Test_Advanced_Dashboard1
{
//calling controller class into the test class
Advanced_Dashboard1 ad = new Advanced_Dashboard1();
list<case> caselist = [select Status,Subject from case where contact.name = 'Smith' and Status != 'Closed' limit 5];
//calling methods into the testclass
ad.getCase1();
ad.getContactname();
}
when i saving the test testclass following error is occuring
Method must define a body
i did not why it is coming .please help me slove this problem.
You need put test to apex method
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex