public void Api_RestClientWrapper_IsGoodResponse_ReturnsCorrectly(RestResponse response, bool expected)
        {
            var restClientWrapper = new RestClientWrapper(new RestClientWrapperCredentials());
            var result            = restClientWrapper.IsGoodResponse(response);

            Assert.AreEqual(expected, result);
        }
示例#2
0
        protected EntertainApiResponse ValidateRestReponse(IRestResponse restResponse)
        {
            var response = new EntertainApiResponse();

            if (!_restClientWrapper.IsGoodResponse(restResponse))
            {
                response.errorSeverity = restResponse.ErrorException != null?restResponse.ErrorException.ToString() : restResponse.StatusDescription;

                response.errorMessage = string.IsNullOrEmpty(restResponse.ErrorMessage) ? restResponse.StatusDescription : restResponse.ErrorMessage;
            }

            CheckXDocumentForErrors(restResponse, response);

            return(response);
        }