Daily Usage Issues

ExcludeFromCodeCoverage not working for anonymous method.

Started by GreenMoose on 6,946 views

v1.46.0.20/NUnit v2.5.7.10213


        [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).

Edited

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

Post a reply

Log in to reply.