I have been getting used to OpenCover over the past few days, and have I noticed that tests using Moles do not generate any Coverage information.
I have created a small solution to isolate the problem, and have found that code coverage is generated only for tests that do not have the [HostType("Moles")]
attribute.
Reading around I have found this and this which seem to be NCover equivalents of my problem. They say that it is something to do with Moles running a profiler as well as the coverage tool, and that there is an environment variable CLRMONITOR_EXTERNAL_PROFILERS
that can be set to allow multiple profilers to run at the same time as Moles - I think that this is where the solution lies, but I'm not 100% sure.
I guess that the variable's value would be the name of the OpenCover profiler - does anyone know this name?
Has anyone managed to get OpenCover running with Moles? Can it be done?