public void GetAllProjectsBDSucess()
        {
            #region Parameters
            List <string> quantityProjectBD = ProjectsBDSteps.ReturnAllProject();

            //Expected Result
            int statusCode = 200;
            #endregion

            #region Request
            allProjects = new GET_AllProjectsRequest();

            response = allProjects.ExecuteRequest();
            JObject resultJsonBody = JObject.Parse(response.Data.ToString());
            #endregion

            #region Asserts
            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusCode, (int)response.StatusCode);
                foreach (JToken IdProjeto in resultJsonBody.SelectTokens("*.id"))
                {
                    string id = IdProjeto.ToString();
                    Assert.IsTrue(GeneralHelpers.VerificaSeStringEstaContidaNaLista(quantityProjectBD, id));
                }
            });
            #endregion
        }
示例#2
0
        public void DadosValidos()
        {
            #region Parameters

            //Resultado esperado
            List <string> dadosProjetos = SolicitacaoDBSteps.RetornaProjetosDB();

            string statusCodeEsperado = "OK";

            #endregion

            ObterTodosProjetosRequest obterTodosProjetosRequest = new ObterTodosProjetosRequest();
            IRestResponse <dynamic>   response = obterTodosProjetosRequest.ExecuteRequest();
            JObject resultadoEsperado          = JObject.Parse(response.Data.ToString());


            Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
            foreach (JToken IdProjeto in resultadoEsperado.SelectTokens("*.id"))
            {
                string id = IdProjeto.ToString();
                Assert.IsTrue(GeneralHelpers.VerificaSeStringEstaContidaNaLista(dadosProjetos, id));
            }
        }