Example #1
0
        public void Should_Throw_AmbiguousTimeoutException_For_Server_Timeout_Error_Code(int errorCode, AnalyticsStatus status)
        {
            using var result = new BlockAnalyticsResult <dynamic>(new MemoryStream(), new DefaultSerializer())
                  {
                      Errors   = new List <Error> { new Error { Code = errorCode } },
                      MetaData = new AnalyticsMetaData
                      {
                          Status = status,
                      }
                  };

            Assert.Throws <AmbiguousTimeoutException>(() => result.ShouldRetry());
        }
Example #2
0
        public void Should_return_true_for_retryable_error_code(int errorCode, AnalyticsStatus status)
        {
            using var result = new BlockAnalyticsResult <dynamic>(new MemoryStream(), new DefaultSerializer())
                  {
                      Errors   = new List <Error> { new Error { Code = errorCode } },
                      MetaData = new AnalyticsMetaData
                      {
                          Status = status,
                      }
                  };

            Assert.True(result.ShouldRetry());
        }