Daily Usage Issues

ExplicitAttribute not respected on TestFixture

Started by Paranoid on 6,639 views

Hi,

The "Explicit" Attribute applied on a whole TestFixture is not respected by NCrunch

namespace xyz
{
    using NUnit.Framework;

    [TestFixture]
    [Explicit]
    public class Test
    {
        [Test]
        public void Runs() // but should not
        {
            Assert.Fail("Should not run");
        }

        [Test]
        [Explicit]
        public void DoesNotRun()
        {
            Assert.Fail();
        }
    }
}
Hi, thanks for sharing this problem.

It looks like something was missed here. I'll include a fix for this in the next build.

As you've discovered, for the time being, it's possible to work around this by applying the attribute at test level instead.
Related question, is there a way to run explicit tests via the NCrunch console runner somehow?
GreenMoose wrote:Related question, is there a way to run explicit tests via the NCrunch console runner somehow?


Unfortunately not. Explicit tests can only be run when specifically targeted for execution, and the console tool will only passively execute.
NCrunch v3.10 has now been released containing a fix for the Explicit attribute declared on fixtures.

Post a reply

Log in to reply.