Build/Test Issues

Coverage feedback for generics?

Started by Alexei Sintotski on 6,217 views

Dear Remco,

I am using generics to implement simple dependency injection mechanism (see below). However, NCrunch does not mark the generic lines as covered with tests.

Is this intentional behavior?

Many thanks in advance!

internal class Deprojector : DeprojectorImpl<DefaultCreator> {};

internal class DeprojectorImpl<Creator> where Creator : ICreator, new()
{
private ImagingAdapters.IPipeline pipeline;

public DeprojectorImpl() {
pipeline = (new Creator()).CreatePipeline();
}

[TestFixture]
public class Test
{
[Test]
public void Create() {
new DeprojectorImpl<MockCreator>();
}
}

Hi Alexei,

Thanks for posting! This could be intentional - can you give me specific details on which of the above lines you see as missing coverage?


Thanks!

Remco

Post a reply

Log in to reply.