function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
babu Balaganibabu Balagani 

Test Classes in Developer Console

Hi,

My test classes are appearing in codecoverage box in developer console.
Previously I used to see only classes in codecoverage box , but now test classes are appearing. And showing Work_Test as 0%.
My Class is Work.
Test Class is Work_Test.
Both were appering in codecoverage box.
Lakshmi Prasanna 9Lakshmi Prasanna 9
hi,
You have to click run test to show code coverege.And need to add annotation '@isTest' at top before class signature.example
@isTest
private class HelloWorldTestClass {
and for the test method add the keyword 'testMethod'.example:
static testMethod void validateHelloWorld() {

make sure all these things.and click run test.
ShashForceShashForce
Hi Babu,

You should add "@isTest" at the beginning of your test class so that it will be identified as a test class and not a regular class.

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank
babu Balaganibabu Balagani
Hi Lakshmi Prasanna 9 & Shashank_SFDC,

I fallowed all these things.

@isTest
private class HelloWorldTestClass {
static testMethod void validateHelloWorld() {

even though my test classes are appearing in code coverage box.
Lakshmi Prasanna 9Lakshmi Prasanna 9
hi,
  If you added @isTest annotation then it didn't show in the code coverage class list.Try this In test tab of developer console click the 'clear all test data' and then click 'run all tests'