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>
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.