** Changed in: nunit-3.0 Assignee: (unassigned) => Charlie Poole (charlie.poole)
** Changed in: nunit-3.0 Status: Triaged => Fix Committed ** Changed in: nunit-3.0 Milestone: None => 2.9.5 -- constraints from ConstraintExpression/ConstraintBuilder are not reusable https://bugs.launchpad.net/bugs/532488 You received this bug notification because you are a member of NUnit Developers, which is subscribed to NUnit V2. Status in NUnit Test Framework: Fix Committed Status in NUnit V2 Test Framework: Fix Released Bug description: Constraint that I receive from syntax helper (Is.Not.Null) is not reusable, but I guess this is more general problem. I found this problem when upgrading nunit.framework.dll from v2.4.6 to v.2.5.3. In both cases tests were executed witn NUnit 2.5.3 console. Worst thing about this problem seems that tests could actually pass when they should fail if you reuse constraint. Here is simple example that demonstrates the problem: using NUnit.Framework; using NUnit.Framework.Constraints; namespace NUnit_2_5_3_bug { [TestFixture] public class FailToReuseConstraint { /// <summary> /// Constraint from <see cref="ConstraintExpression"/>. /// </summary> /// <remarks> /// Demonstrates that constraint received from syntax helper is not reusable. /// </remarks> [Test] public void FromSyntaxHelper() { Constraint expression = Is.Not.Null; Assert.That(this, expression, "one"); Assert.That(this, expression, "two"); // this step fails on NUnit.2.5.3 } /// <summary> /// How NUnit 2.4 did it (i think). /// </summary> [Test] public void NotConstraint() { Constraint expression = new NotConstraint(Is.Null); Assert.That(this, expression, "one"); Assert.That(this, expression, "two"); } } } _______________________________________________ Mailing list: https://launchpad.net/~nunit-core Post to : nunit-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~nunit-core More help : https://help.launchpad.net/ListHelp