You need to sign in to do that
Don't have an account?
neeedhelp
Where can I find a Test Class?
Where can I find a test class written for a particular apex class.......I can only see the code covered for a particular class but unable to find the test class for it.....
Generally, based on naming convention the test class will have prefix or suffix - test and the name of the base class.
E.g if your base class is called SomeClass the test class must (if naming convention is adehered to) have names something like Test_SomeClass , SomeClass_Test, TestSomeClass, SomeClassTest .
There may be better ways, but generally this is how i search -
In the IDE do a search (Search > File) and type the name of the base class , this may bring up the test class.
OR
In your org, Develop > Apex Classes > View Test Classes (create a view if one doesn't already exist) and search the name of base class, you may find the test class
Hope this helps.
All Answers
Take a look at this section. This is where i got an idea of how this whole test thing works.
http://www.salesforce.com/us/developer/docs/workbook/forcecom_workbook.pdf
I yhink u didnt got my question.........In my dev org there is already a test class written for a particular class....I wanna see that test class....Hw can I view it
Logon and click on your name and then go setup.
on the left pane , go to App setup - Develop and if you are an admin, then you see apex classes and then click on the test class that you created.
hth!
Generally, based on naming convention the test class will have prefix or suffix - test and the name of the base class.
E.g if your base class is called SomeClass the test class must (if naming convention is adehered to) have names something like Test_SomeClass , SomeClass_Test, TestSomeClass, SomeClassTest .
There may be better ways, but generally this is how i search -
In the IDE do a search (Search > File) and type the name of the base class , this may bring up the test class.
OR
In your org, Develop > Apex Classes > View Test Classes (create a view if one doesn't already exist) and search the name of base class, you may find the test class
Hope this helps.
Yes, to my knowledge there is no functionality to automatically find a related test class. A best practise would be naming conventions, or having the test methods in your class itself (I prefer this). If neither is the case, and you have a lot of classes, you may need to browse through all of them (and go have a talk to whover coded it).