public void testRetryAfterWithNoQueryString() { string invalidTopic = "$dps/registrations/res/429/"; TimeSpan?actual = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(invalidTopic, defaultInterval); Assert.IsNull(actual); }
public void testRetryAfterWithNoTopicString() { string invalidTopic = ""; TimeSpan?actual = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(invalidTopic, defaultInterval); Assert.IsNull(actual); }
public void testRetryAfterValidAccepted() { TimeSpan?actual = ProvisioningErrorDetailsMqtt.GetRetryAfterFromTopic(validTopicNameAccepted, defaultInterval); Assert.IsNotNull(actual); Assert.AreEqual(acceptedDelay, actual?.Seconds); }
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); }