Skip to content

Assert.ThatAsync does not support polling #4811

@Dreamescaper

Description

@Dreamescaper
        var i = 0;
        async Task<string> GetResult()
        {
            return new string('1', i++);
        }

        await Assert.ThatAsync(GetResult, Is.Not.Empty.After(1000, 10));

Expected Result:
GetResult function returns non-empty result on second execution. So assertion should pass, since it has polling interval.

Actual Result:
Nunit invokes GetResult only once, therefore it fails.

Assert.That(GetResult, Is.Not.Empty.After(1000, 10))
  Expected: not <empty> after 1000 milliseconds delay
  But was:  <string.Empty>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions