Exemplo n.º 1
0
        public IRestResponse <dynamic> ExecuteRequest()
        {
            IRestResponse <dynamic> response;

            if (apiSpotfy)
            {
                response = RestSharpHelpers.ExecuteRequest(urlSpotify, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                ExtentReportHelpers.AddTestInfo(urlSpotify, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }
            else if (apiGerarTokenSpotfy)
            {
                response = RestSharpHelpers.ExecuteRequest(urlGerarTokenSpotify, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                //ExtentReportHelpers.AddTestInfo(urlGerarTokenSpotify, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }
            else
            {
                response = RestSharpHelpers.ExecuteRequest(urlMantis, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                ExtentReportHelpers.AddTestInfo(urlMantis, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }

            return(response);
        }
Exemplo n.º 2
0
        public IRestResponse <dynamic> ExecuteRequestTest()
        {
            IRestResponse <dynamic> response = RestSharpHelpers.ExecuteRequest(url, requestService, method, headers, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

            //  ExtentReportHelpers.AddTestInfo(url, requestService, method.ToString(), headers, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);

            return(response);
        }
Exemplo n.º 3
0
        public void BuscarUsuarios2()
        {
            string statusCodeEsperado = "OK";
            string url            = "https://reqres.in";
            string requestService = "/api/users?page=2";
            Method method         = Method.GET;

            IRestResponse <dynamic> response = RestSharpHelpers.ExecuteRequest(url, requestService, method);

            Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
            Assert.Greater((int)response.Data["total"], 1);
        }