public void RetornaTodosProjetosVerificaSubProjeto()
        {
            string nomeProjetoEsperado = "Teste SubProjeto";
            string idProjetoEsperado   = "2";

            GetAllProjectsRequest getAllProjectsRequest = new GetAllProjectsRequest();

            IRestResponse <dynamic> response = getAllProjectsRequest.ExecuteRequest();

            string idProjetoRetornado   = response.Data["projects"][1]["id"];
            string nomeProjetoRetornado = response.Data["projects"][1]["name"];

            Assert.Multiple(() =>
            {
                Assert.AreEqual(System.Net.HttpStatusCode.OK, response.StatusCode);
                Assert.AreEqual(nomeProjetoEsperado, nomeProjetoRetornado);
                Assert.AreEqual(idProjetoEsperado, idProjetoRetornado);
            });
        }
示例#2
0
        public void Test_ObterTodosOsProjetosComSucesso()
        {
            #region Parameters
            string statusEsperado = "OK";

            string projectName1 = "Project 01 Default";
            string description1 = "Project 01 Default description";

            string projectName2 = "Projeto 03 Updated";
            string description2 = "Project 03 Update description";
            #endregion

            #region Acoes
            GetAllProjectsRequest   getAllProjectsRequest = new GetAllProjectsRequest();
            IRestResponse <dynamic> response = getAllProjectsRequest.ExecuteRequest();
            #endregion

            #region Asserts
            int    idResposta          = response.Data["projects"][0]["id"];
            string nomeResposta        = response.Data["projects"][0]["name"];
            string descriptionResposta = response.Data["projects"][0]["description"];

            int    idResposta2          = response.Data["projects"][1]["id"];
            string nomeResposta2        = response.Data["projects"][1]["name"];
            string descriptionResposta2 = response.Data["projects"][1]["description"];

            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusEsperado, response.StatusCode.ToString());
                Assert.AreEqual(projectName1, nomeResposta);
                Assert.AreEqual(description1, descriptionResposta);

                Assert.AreEqual(projectName2, nomeResposta2);
                Assert.AreEqual(description2, descriptionResposta2);
            });
            #endregion
        }