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
moverdorfmoverdorf 

Managed vs UnManaged Code - Test results vary....

I cloned a class and ran my test class against BOTH the original and the cloned version.

 

The original says I have 48% coverage, the clone says 80%. The reason for the difference is that the original (managed code) says that the number of lines to test coverage for is 1036 and the cloned version (unmanaged code) says I have 612 lines to test.

 

My question now is, what is the difference when performing Test coverage on MANAGED vs UNMANAGED code?

 

Thanks!

Deepak Kumar ShyoranDeepak Kumar Shyoran

Hi 

moverdorfmoverdorf

I thought the same thing, that somehow the managed code was counting comments and whitespace lines as additional lines of code. The problem is once the code is deemed "managed" you can't click the Code Coverage link to see the covered/non covered lines of code.

 

I noticed that if I ran the test in Force IDE, the test comes back corect saying I have 82% coverage. So the issue is with the SalesForce interface.

Deepak Kumar ShyoranDeepak Kumar Shyoran

Yes this is a problem at salesforce end and it's not a big issue these kind of test classes will automatically correct when you deploy that class to the production org.

 

 

If this post helps you then hit kudus by clicking on star and accept my post as a solution to your question.