public void DefaultValues() { // Arrange var config = new TransportOptions(); // Assert Assert.Equal(110, config.LongPolling.PollTimeout.TotalSeconds); Assert.Equal(30, config.DisconnectTimeout.TotalSeconds); Assert.Equal(10, config.KeepAlive.Value.TotalSeconds); Assert.Equal(20, config.KeepAliveTimeout().Value.TotalSeconds); Assert.Equal(5, config.HeartbeatInterval().TotalSeconds); Assert.Equal(100, config.TopicTtl().TotalSeconds); }
public void TopicTopicTimeToLiveIsDoubleTheDisconnectTimeoutWhenKeepAliveIsNull() { var config = new TransportOptions(); var random = new Random(); config.DisconnectTimeout = TimeSpan.FromSeconds(random.Next(6, 31536000)); // 12 seconds to a year config.KeepAlive = null; // Assert Assert.Equal(TimeSpan.FromTicks(config.DisconnectTimeout.Ticks * 2), config.TopicTtl()); }
public void TopicTimeToLiveIsDoubleTheDisconnectAndKeepAliveTimeouts() { var config = new TransportOptions(); var random = new Random(); config.DisconnectTimeout = TimeSpan.FromSeconds(random.Next(12, 31536000)); // 12 seconds to a year config.KeepAlive = TimeSpan.FromTicks(config.DisconnectTimeout.Ticks / 6); // Set custom keep-alive to half the default // Assert Assert.Equal(TimeSpan.FromTicks(config.DisconnectTimeout.Ticks * 2 + config.KeepAliveTimeout().Value.Ticks * 2), config.TopicTtl()); }