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

Notification

Icon
Error

ExcludeFromCodeCoverage not working for anonymous method.
GreenMoose
#1 Posted : Friday, August 23, 2013 6:06:07 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 509

Thanks: 147 times
Was thanked: 66 time(s) in 64 post(s)
v1.46.0.20/NUnit v2.5.7.10213

Code:

        [Test]
        [ExcludeFromCodeCoverage]
        public void CanDoSomething()
        {
            Assert.IsTrue(true);
            var values = Enumerable.Range(0, 10)
                                   .Select(x => x);
        }


The .select is indicating missing coverage (also drops metrics).
Remco
#2 Posted : Friday, August 23, 2013 6:10:49 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 995 times
Was thanked: 1338 time(s) in 1241 post(s)
Thanks for sharing this.

Physically, the lambda is in a completely different generated method, so I'm not sure how many options there'll be for fixing this ... But I'll see what I can do.

Cheers,

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.015 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download