Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Coverage feedback for generics?
Alexei Sintotski
#1 Posted : Thursday, March 8, 2012 3:34:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/8/2012(UTC)
Posts: 1

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>();
}
}

Remco
#2 Posted : Thursday, March 8, 2012 6:41:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download