Beispiel #1
0
        public void ComputeHeartbeatIntervalWorks()
        {
            ConsulHeartbeatOptions opts = new ConsulHeartbeatOptions();
            var period = opts.ComputeHearbeatInterval();

            Assert.Equal(TimeSpan.FromSeconds(20), period);
        }
Beispiel #2
0
        public void ComputeShortHeartbeat()
        {
            ConsulHeartbeatOptions opts = new ConsulHeartbeatOptions();

            opts.TtlValue = 2;
            var period = opts.ComputeHearbeatInterval();

            Assert.Equal(TimeSpan.FromSeconds(1), period);
        }
Beispiel #3
0
        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);
        }