public void WaitTryForAnyActionMultipleTimeTest() { DateTime start = DateTime.Now; TimeSpan max = TimeSpan.FromSeconds(2); DateTime dateToTest = DateTime.Now.AddSeconds(120); DateTime otherDateToTest = DateTime.Now.AddSeconds(1); GenericWait.WaitTryForAnyAction <bool>( "WaitForListOfActions", TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(0.5), out bool result, () => { Assert.IsTrue(dateToTest < DateTime.Now); return(true); }, () => { Assert.IsTrue(otherDateToTest < DateTime.Now); return(true); }); TimeSpan duration = DateTime.Now - start; Assert.IsTrue(duration < max, "WaitTryForAnyActionMultipleTimeTest longer than " + duration); }
public void WaitTryForAnyActionMultipleTest() { DateTime dateToTest = DateTime.Now.AddSeconds(120); DateTime otherDateToTest = DateTime.Now.AddSeconds(1); GenericWait.WaitTryForAnyAction <bool>( "WaitForListOfActions", TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(0.5), out bool result, () => { Assert.IsTrue(dateToTest < DateTime.Now); return(true); }, () => { Assert.IsTrue(otherDateToTest < DateTime.Now); return(true); }); Assert.IsTrue(result, "Result did not return a true value"); }