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

Notification

Icon
Error

NUnit - Parameterised / Generic Test Fixtures show black indicators
chappoo
#1 Posted : Wednesday, October 5, 2011 10:00:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/5/2011(UTC)
Posts: 1
Location: Sydney

Thanks: 1 times
Hi, great tool! I've encountered what looks like a bug - hope it's easy to fix up. Let me know if you concur or already know about this and I'll raise a bug report accordingly.

With NUnit 2.5, parameterised & generic test fixtures were introduced (http://www.nunit.org/index.php?p=testFixture&r=2.5). NCrunch doesn't show them as 'Green' (they're reported as passed in NCrunch Tests but all indicators are black). It's almost as if the test fixture isn't recognised by the syntax highlighting, as the test fixture code is being shown as black too (i.e."un-covered").

Sample code (useless but demonstrates the issue at hand!):

Code:

    public class Value<T>
    {
        private readonly T _value;

        public Value(T value)
        {
            _value = value;
        }

        public T TheValue
        {
            get { return _value; }
        }
    }

    [TestFixture("some value")]
    public class ParameterizedFixture
    {
        private readonly string _value;

        public ParameterizedFixture(string value)
        {
            this._value = value;
        }

        [Test]
        public void Test()
        {
            var value = new Value<string>(_value);
            Assert.AreEqual("some value", value.TheValue);
        }
    }

    [TestFixture(typeof(object))]
    public class GenericFixture<T> where T : new()
    {
        private readonly T _value = new T();

        [Test]
        public void Test()
        {
            var value = new Value<T>(_value);
            Assert.AreEqual(_value, value.TheValue);
        }
    }

    [TestFixture(typeof(string), "some value")]
    public class GenericAndParameterizedFixture<T>
    {
        private readonly T _value;

        public GenericAndParameterizedFixture(T value)
        {
            this._value = value;
        }

        [Test]
        public void Test()
        {
            var value = new Value<T>(_value);
            Assert.AreEqual("some value", value.TheValue);
        }
    }
Remco
#2 Posted : Thursday, October 6, 2011 6:47:27 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

Yes - NCrunch does not yet have full support for all of NUnit 2.5's features. Improvements in this area have been heavily requested (you'll probably see a number of similar posts in this forum), so it won't be far away :)

Cheers,

Remco
Remco
#3 Posted : Tuesday, October 18, 2011 6:29:18 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
This issue should be fixed in the 1.35b build that was released this morning.
1 user thanked Remco for this useful post.
chappoo on 10/24/2011(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.035 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download