public void WillHonorSuggest( [Values(90, 100, 120)] int suggest) { var strategy = new ConstantDelayStrategy(); var expected = TimeSpan.FromSeconds(suggest); Assert.AreEqual(expected, strategy.GetNextDelay(_mockResponse, TimeSpan.FromSeconds(suggest))); }
public void Constant() { IDelayStrategy strategy = new ConstantDelayStrategy(TimeSpan.FromSeconds(1)); Assert.AreEqual(TimeSpan.FromSeconds(1), strategy.NextDelay()); Assert.AreEqual(TimeSpan.FromSeconds(1), strategy.NextDelay()); Assert.AreEqual(TimeSpan.FromSeconds(1), strategy.NextDelay()); Assert.AreEqual(TimeSpan.FromSeconds(1), strategy.NextDelay()); }
public void DefaultShouldUseOneSecond(int count) { var strategy = new ConstantDelayStrategy(); TimeSpan total = TimeSpan.Zero; TimeSpan expected = TimeSpan.FromSeconds(count); for (int i = 0; i < count; i++) { total += strategy.GetNextDelay(_mockResponse, null); } Assert.AreEqual(expected, total); }