Methods/Properties called by reflection show as not tested

I asume dotCover uses a sinmpler approach and does not instrument the code. I do have 100 % coverage with code calling by reflection, but doCover does how that methods/properties as not covered.

What is the solution for this ? I do NOT want to write 100 test methods when the call is basically the same and I can write a simple refelction loop which invokes the methods.

1 comment

Hello Joe,

dotCover is expected to process methods and properties called with reflection properly. In the attachment you can find a solution and two snapshots illustrating the issue. The solution contains a class ReflectionClass and a code calling methods and properties of this class with reflection. Snapshot Reflection_CoverStartUp.dcvr was made using ReSharper > Cover > Cover Startup Project menu. Snapshot Reflection_Tests.dcvr was made using ReSharper > Unit Tests > Cover Unit Tests menu. In both snapshots we can see that ReflectionClass is 100% covered.

So in order to resolve your problem I need some additional information on your case, for example a sample solution on which I can reproduce and investigate the problem.

Best regards.


Please sign in to leave a comment.