Build/Test Issues

'Consider inconclusive tests as passing' does not work for [Theory] tests.

Started by otac0n on 4,820 views

This fails, regardless of wheter or not the 'Consider inconclusive tests as passing' setting is enabled.

using System;
using NUnit.Framework;

namespace ReproNCrunchIssue
{
    [TestFixture]
    public class TypeTests
    {
        [Datapoints]
        private Type[] types = { typeof(int), typeof(string) };

        [Theory]
        public void TypeTest(Type type)
        {
            Assume.That(type, Is.Not.EqualTo(typeof(string)));
        }
    }
}
This works fine:

using System;
using NUnit.Framework;

namespace ReproNCrunchIssue
{
    [TestFixture]
    public class TypeTests
    {
        private Type[] types = { typeof(int), typeof(string) };

        [TestCaseSource("types")]
        public void TypeTest(Type type)
        {
            Assume.That(type, Is.Not.EqualTo(typeof(string)));
        }
    }
}
Hi,

Thanks for sharing this issue. I can see the same behaviour on my side. This doesn't look right.

I'll take a deeper look and will see what I can do.


Cheers,

Remco

Post a reply

Log in to reply.