Skip to content

DelayedConstraint calls delegate twice #2841

Closed
@juergstaub

Description

@juergstaub

NUnit 3.10.1, simple test case shown below. The IsComplete is called twice.

    [TestFixture()]
    class MyTests
    {
        private int c = 0;


        [Test]
        public void TestConstraint()
        {
            var constraint = Is.True.After(10).Minutes.PollEvery(5000).MilliSeconds;
            Assert.That(IsComplete, constraint);
        }


        public bool IsComplete()
        {
            TestContext.Progress.WriteLine("InComplete");
            if ( c == 5 ) return true;
            c++;
            return false;
        }
    }

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions