Ejemplo n.º 1
0
        public void When_AdHoc_Is_Default_Or_True_CheckRetry_Should_Return_False()
        {
            var requestExplicit = new QueryRequest().AdHoc(true);
            var requestDefault  = new QueryRequest();
            var response        = new QueryResult <string>()
            {
                Success = true
            };

            Assert.IsFalse(QueryClient.CheckRetry(requestExplicit, response));
            Assert.IsFalse(QueryClient.CheckRetry(requestDefault, response));
        }
Ejemplo n.º 2
0
        public void When_AdHoc_Is_False_And_HasBeenRetried_CheckRetry_Should_Return_False()
        {
            var requestAdhocRetried = new QueryRequest().AdHoc(false);

            requestAdhocRetried.HasBeenRetried = true;
            var response = new QueryResult <string>()
            {
                Success = true
            };

            Assert.IsFalse(QueryClient.CheckRetry(requestAdhocRetried, response));
        }
Ejemplo n.º 3
0
        public void When_Identified_Error_Are_Encountered_CheckRetry_Should_Return_True()
        {
            var listErrors = new System.Collections.Generic.List <Error>();
            var error4070  = new Error()
            {
                Code    = 4070,
                Message = "whatever"
            };
            var error4050 = new Error()
            {
                Code    = 4050,
                Message = "whatever"
            };
            var error5000 = new Error()
            {
                Code    = 5000,
                Message = "somePrefix" + QueryClient.ERROR_5000_MSG_QUERYPORT_INDEXNOTFOUND + "someSuffix"
            };
            var notAnError5000 = new Error()
            {
                Code    = 5000,
                Message = "Syntax Error"
            };

            var request  = new QueryRequest().AdHoc(false);
            var response = new QueryResult <string>()
            {
                Errors  = listErrors,
                Success = false
            };

            listErrors.Add(error4050);
            Assert.IsTrue(QueryClient.CheckRetry(request, response));

            listErrors.Clear();
            listErrors.Add(error4070);
            Assert.IsTrue(QueryClient.CheckRetry(request, response));

            listErrors.Clear();
            listErrors.Add(error5000);
            Assert.IsTrue(QueryClient.CheckRetry(request, response));

            listErrors.Clear();
            listErrors.Add(notAnError5000);
            Assert.IsFalse(QueryClient.CheckRetry(request, response));
        }