Exemple #1
0
        public void ReturnTrueWhenTryParseIsCalledWithAnEventuallyConsistentTagLabel(string label)
        {
            Assert
            .IsTrue(
                EventuallyConsistentTagParser.TryParse(label, out var tag));

            Assert.IsNotNull(tag);
        }
Exemple #2
0
        public void ReturnFalseWhenTryParseIsCalledWithADifferentTagLabel()
        {
            Assert
            .IsFalse(
                EventuallyConsistentTagParser.TryParse("somethingElse", out var tag));

            Assert.IsNull(tag);
        }
Exemple #3
0
        public void SetTheOutVariableWithTheExpectedEventuallyConsistentTagWhenABothWithinAndRetryIntervalValuesAreProvidedInTheLabel(string label)
        {
            EventuallyConsistentTagParser.TryParse(label, out var tag);

            Assert.AreEqual(
                TimeSpan.FromSeconds(30),
                tag.Within);

            Assert.AreEqual(
                TimeSpan.FromSeconds(10),
                tag.RetryInterval);
        }
Exemple #4
0
        public void SetTheOutVariableWithTheExpectedEventuallyConsistentTagWhenARetryIntervalValueIsProvidedInTheLabel()
        {
            EventuallyConsistentTagParser.TryParse("eventuallyConsistent(retryInterval=00:00:10)", out var tag);

            Assert.AreEqual(
                TimeSpan.FromSeconds(20),
                tag.Within);

            Assert.AreEqual(
                TimeSpan.FromSeconds(10),
                tag.RetryInterval);
        }
Exemple #5
0
        public void SetTheOutVariableWithTheExpectedEventuallyConsistentTagWhenNoSettingsAreProvidedInTheLabel()
        {
            EventuallyConsistentTagParser.TryParse("eventuallyConsistent", out var tag);

            Assert.AreEqual(
                TimeSpan.FromSeconds(20),
                tag.Within);

            Assert.AreEqual(
                TimeSpan.FromSeconds(5),
                tag.RetryInterval);
        }