Exemple #1
0
        public void testRetryAfterWithNoQueryString()
        {
            string   invalidTopic = "$dps/registrations/res/429/";
            TimeSpan?actual       = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(invalidTopic, defaultInterval);

            Assert.IsNull(actual);
        }
Exemple #2
0
        public void testRetryAfterWithNoTopicString()
        {
            string   invalidTopic = "";
            TimeSpan?actual       = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(invalidTopic, defaultInterval);

            Assert.IsNull(actual);
        }
Exemple #3
0
        public void testRetryAfterValidAccepted()
        {
            TimeSpan?actual = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(validTopicNameAccepted, defaultInterval);

            Assert.IsNotNull(actual);
            Assert.AreEqual(acceptedDelay, actual?.Seconds);
        }
Exemple #4
0
        public void testRetryAfterWithNegativeDelayChoosesDefault()
        {
            string   invalidTopic = "$dps/registrations/res/429/?$rid=9&Retry-After=-1";
            TimeSpan?actual       = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(invalidTopic, defaultInterval);

            Assert.IsNotNull(actual);
            Assert.AreEqual(defaultInterval.Seconds, actual?.Seconds);
        }