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

Help With Test Class for apex class please
Hi,
Can any one help me out to write test class for below apex class.
public class StopRecursivecall
{
private static boolean Update_OnBehalfendUserStatus = false;
public static boolean hasUpdate_OnBehalfendUserStatus()
{
return Update_OnBehalfendUserStatus;
}
public static void setUpdate_OnBehalfendUserStatus() {
Update_OnBehalfendUserStatus = true;
}
}
Thanks,
Indu.
As yvk mentioned, its pretty straight forward to write test class for it.
Moreover, I think you are using this class to avoid recursive call of your triggers, therefore It should be covered when your actual scenario occurs.
If its not covered with triggers, You can instantiate the Apex Class and call the methods to cover it ion test method.
Cheers!
All Answers
May I know your problem, it looked pretty straight forward.
--yvk
As yvk mentioned, its pretty straight forward to write test class for it.
Moreover, I think you are using this class to avoid recursive call of your triggers, therefore It should be covered when your actual scenario occurs.
If its not covered with triggers, You can instantiate the Apex Class and call the methods to cover it ion test method.
Cheers!
hi
tyr these
@istest
public class testStopRecursivecall
{
public static testMethod void myTest()
{
StopRecursivecall sr=new StopRecursivecall();
StopRecursivecall.setUpdate_OnBehalfendUserStatus();
StopRecursivecall.hasUpdate_OnBehalfendUserStatus();
}
}
You donteven need to instantiate since they are static methods.
--yvk
Hi..Thanks for your reply.Your answer solved my problem & doubt.
Thanks & Regards,
Indu