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

Notification

Icon
Error

ExplicitAttribute not respected on TestFixture
Paranoid
#1 Posted : Wednesday, June 21, 2017 1:05:31 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 2
Location: Germany

Thanks: 2 times
Hi,

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

Code:
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();
        }
    }
}
Remco
#2 Posted : Wednesday, June 21, 2017 11:32:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
1 user thanked Remco for this useful post.
Paranoid on 6/22/2017(UTC)
GreenMoose
#3 Posted : Thursday, June 22, 2017 12:28:41 PM(UTC)
Rank: Advanced Member

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

Thanks: 142 times
Was thanked: 66 time(s) in 64 post(s)
Related question, is there a way to run explicit tests via the NCrunch console runner somehow?
Remco
#4 Posted : Thursday, June 22, 2017 9:38:05 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
GreenMoose;10681 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.
Remco
#5 Posted : Tuesday, July 18, 2017 1:19:24 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch v3.10 has now been released containing a fix for the Explicit attribute declared on fixtures.
1 user thanked Remco for this useful post.
Paranoid on 7/18/2017(UTC)
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.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download