public static long CountTime(Action action)
{
var stopwatch = Stopwatch.StartNew();
action();
return stopwatch.ElapsedMilliseconds;
}
public void TestTryUntilWithTryInterval() { var times = 5; var generator = new Generator(times); bool result = false; Expect(RetryHelperTest.CountTime(() => result = _target.Try(() => generator.Next()).WithTryInterval(RetryHelperTest.Interval * 2).Until(t => t)), EqualTo(RetryHelperTest.Interval * 2 * times).Within(RetryHelperTest.Tolerance)); Expect(result, True); }