You need to sign in to do that
Don't have an account?
VSK98
Method does not exist or incorrect signature in test class
Hi All,
I have a Custom Controller like
Regards,
VSK
I have a Custom Controller like
public class classname{ public classname(){ ---------Do Sum Logic--------- } } .............................. I have written in test like PageReference pageRef = Page.MyPage; pageRef.getparameters().put('id','obj.id); Test.setCurrentPageReference(pageRef); classname cont = new classname(); cont.classname() ------------------------------Showing error hereAny Suggestions
Regards,
VSK
Try the following line instead of 14th line - ------------
Thanks,
Srinivas
- Please mark as solution if your problem is resolved.
and its called automatically when you instantiate an sObject variable
classname cont = new classname();
You don't need to call it separately (Line 18).
Public classes other than constructor are caleed that way.
Mark this as Best Answer, if this solves your problem.