public void ConstantDelayPolicy_ReturnsSameDelay_ForRangeOfInput() { TimeSpan expectedDelay = TimeSpan.FromMilliseconds(100); var policy = new ConstantDelayPolicy(expectedDelay); foreach (int i in Enumerable.Range(0, 100)) { Assert.AreEqual(expectedDelay, policy.GetDelay(i)); } }
public void ConstantDelayPolicy_ReturnsSameDelay_ForRandomInput() { TimeSpan expectedDelay = TimeSpan.FromSeconds(10); var policy = new ConstantDelayPolicy(expectedDelay); var random = new Random(); foreach (int i in Enumerable.Range(0, 100)) { Assert.AreEqual(expectedDelay, policy.GetDelay(random.Next())); } }