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
tdevmantdevman 

test coverage issue

Starz26Starz26

There are all kinds of no no's in your test class and trigger:

 

SOQL of entire objects without limits

Hardcoded ID's

seeAllData = true

 

etc.

 

But for your initial question, when you select the class and select run test, after it has executed, scroll down to the trigger you are seeking and see what it says for coverage. click on the code coverage percent and it will tell you what lines are not covered.

 

This WILL NOT set the percent coverage when viewing apex classes. to do that you have to run the test via Apex Test Execution under Setup -> Develop -> Test Execution.

 

Lets start there. Also, when clicking run test, does it pass or fail?

 

 

Jaffer Ali.Jaffer Ali.

Try to make a negative case where you will receive some sort of exception . May be you can develop a code to associate inactive user Id so you will receive an exception as a result.

 

Jaffer Ali.Jaffer Ali.

In test class Im able to see hardoded Id.What is the reson for that ? It  will change in production so what would you do then?