public async Task <T> GetAsync <T>(IProbe <T> probe) where T : class { var timeout = new Timeout(_timeoutMillis); T sample = null; while (!probe.IsSatisfied(sample)) { if (timeout.HasTimedOut()) { throw new AssertErrorException(DescribeFailureOf(probe)); } Thread.Sleep(_pollDelayMillis); sample = await probe.GetSampleAsync(); } return(sample); }