开发者

Mysterious behaviour change of NUnit constraints

开发者 https://www.devze.com 2023-03-24 18:22 出处:网络
The following tests pass when using NUnit 2.4.8 and fail with NUnit 2.5.10: using NUnit.Framework; namespace SimpleTests

The following tests pass when using NUnit 2.4.8 and fail with NUnit 2.5.10:

using NUnit.Framework;

namespace SimpleTests
{
    [TestFixture]
    p开发者_开发百科ublic class NotConstraintTest
    {
        [Test]
        public void TestNotEquals()
        {
            var constraint = Is.Not.EqualTo("foo");
            Assert.That(constraint.Matches("bar"));
        }

        [Test]
        public void TestNotEmpty()
        {
            var constraint = Is.Not.Empty;
            Assert.That(constraint.Matches(new[] { "one", "two" }));
        }
    }
}

Did I miss anything subtle?

0

精彩评论

暂无评论...
验证码 换一张
取 消