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

how to include get method in test class
Hi Everyone,
Please help me in writing test class for below code
Thanks in advance!
Please help me in writing test class for below code
Thanks in advance!
Apex Code example: public class Example{ public class myMethod{ //code block } public Example getAbc{ return abc; } public pagereference save() { //code block } }
Can you please refer to the below link
https://salesforce.stackexchange.com/questions/152385/test-class-coverage-for-get-method
Hope this is helpful!
Regards,
Ranjan
I'm sorry but your code sample makes no sense.
Of course you can name classes, variables, and methods any way you want, but if you want other people to be able to make sense of your code you have to use rational names. This in particular makes no sense: "public class myMethod{". Classes contain methods, so naming a class "myMethod" damages understanding. Your class is not static, so it has to be instantiated to call its methods.
Maybe the following is something like what you meant? Your test then could look like this: Hopefully you will find this helpful. (sorry for complaining about your names)