public void BackoffExponential() { var random = new Random(); var min = random.Next(1, 100); var max = random.Next(101, 1000); var t = Strategies.Backoff(Strategy.Exponential, min, max); Assert.IsNotNull(t as BackoffTiming); Assert.IsNotNull(t.Timing as ExponentialTiming); }
public void BackoffLinear() { var random = new Random(); var min = random.Next(1, 100); var max = random.Next(101, 1000); var t = Strategies.Backoff(Strategy.Linear, min, max); Assert.IsNotNull(t as BackoffTiming); Assert.IsNotNull(t.Timing as LinearTiming); }
/// <summary> /// Default Constructor /// </summary> /// <param name="minimumPeriodInSeconds">Minimum, time in seconds</param> /// <param name="maximumPeriodInSeconds">Maximum, time in seconds</param> /// <param name="strategy">Timing Strategy</param> public BackoffTask(int minimumPeriodInSeconds = BaseTimes.DefaultMinimumTiming, int maximumPeriodInSeconds = BaseTimes.DefaultMaximumTiming, Strategy strategy = Strategy.Exponential) : base(Strategies.Backoff(strategy, minimumPeriodInSeconds, maximumPeriodInSeconds)) { }