public void ComputeHeartbeatIntervalWorks() { ConsulHeartbeatOptions opts = new ConsulHeartbeatOptions(); var period = opts.ComputeHearbeatInterval(); Assert.Equal(TimeSpan.FromSeconds(20), period); }
public void ComputeShortHeartbeat() { ConsulHeartbeatOptions opts = new ConsulHeartbeatOptions(); opts.TtlValue = 2; var period = opts.ComputeHearbeatInterval(); Assert.Equal(TimeSpan.FromSeconds(1), period); }
public void ComputeHeartbeatIntervalWorks(int ttl, string unit, double ratio, int expected) { ConsulHeartbeatOptions opts = new ConsulHeartbeatOptions(); opts.TtlValue = ttl; opts.TtlUnit = unit; opts.IntervalRatio = ratio; var period = opts.ComputeHearbeatInterval(); Assert.Equal(TimeSpan.FromMilliseconds(expected), period); }