Пример #1
0
 public void DeletarProjeto()
 {
     #region Parameters
     string nomeProjeto        = "projeto delete";
     string statusCodeEsperado = "OK";
     #endregion
     string idProjeto = helpersProjetos.PreparaBaseCadastradoProjeto(nomeProjeto);
     deletaProjetoRequests.SetParameters(idProjeto);
     IRestResponse <dynamic> response = deletaProjetoRequests.ExecuteRequest();
     Assert.Multiple(() =>
     {
         Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
         Assert.AreEqual(0, ProjetoDBSteps.VerificaProjetoExiste(nomeProjeto));
     });
 }
Пример #2
0
 public void ProjetoJaCadastrado()
 {
     #region parameters
     string nomeProjeto        = "projeto ja cadastrado";
     string descricaoErro      = "call to undefined method restfault::getmessage() in ";
     string statuscodeesperado = "OK";
     #endregion
     helpersProjetos.PreparaBaseCadastradoProjeto(nomeProjeto);
     cadastraProjetoRequests.SetJsonBody(nomeProjeto, descricaoErro);
     IRestResponse <dynamic> response = cadastraProjetoRequests.ExecuteRequest();
     string body = response.Content;
     Assert.Multiple(() =>
     {
         Assert.AreEqual(statuscodeesperado, response.StatusCode.ToString());
         Assert.That(true, descricaoErro, response.Content);
         Assert.AreEqual(1, ProjetoDBSteps.VerificaProjetoExiste(nomeProjeto));
     });
 }
Пример #3
0
        public void CadastrarProjetoSucesso()
        {
            #region Parameters
            string nomeProjeto        = "projeto teste";
            string descricao          = "projeto teste";
            string statusCodeEsperado = "Created";
            #endregion
            helpersProjetos.PreparaBaseDeletadoProjeto(nomeProjeto);
            cadastraProjetoRequests.SetJsonBody(nomeProjeto, descricao);
            IRestResponse <dynamic> response = cadastraProjetoRequests.ExecuteRequest();
            string retornoNomeProjetc        = response.Data["project"]["name"];
            string retornoDescricaoProjetc   = response.Data["project"]["description"];

            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
                Assert.AreEqual(nomeProjeto, retornoNomeProjetc);
                Assert.AreEqual(descricao, retornoDescricaoProjetc);
                Assert.AreEqual(1, ProjetoDBSteps.VerificaProjetoExiste(nomeProjeto));
            });
        }
Пример #4
0
 public void AtualizarProjeto()
 {
     #region Parameters
     string nomeProjetoEdicao  = "projeto atualizar";
     string statusCodeEsperado = "OK";
     string nomeProjetoNovo    = "projeto novo";
     #endregion
     string idProjeto = helpersProjetos.PreparaBaseCadastradoProjeto(nomeProjetoEdicao);
     helpersProjetos.PreparaBaseDeletadoProjeto(nomeProjetoNovo);
     atualizaProjetoRequests.SetParameters(idProjeto);
     atualizaProjetoRequests.SetJsonBody(nomeProjetoNovo, idProjeto);
     IRestResponse <dynamic> response = atualizaProjetoRequests.ExecuteRequest();
     string retornoNomeProjetc        = response.Data["project"]["name"];
     string retornoIdProjetc          = response.Data["project"]["id"];
     Assert.Multiple(() =>
     {
         Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
         Assert.AreEqual(nomeProjetoNovo, retornoNomeProjetc);
         Assert.AreEqual(idProjeto, retornoIdProjetc);
         Assert.AreEqual(0, ProjetoDBSteps.VerificaProjetoExiste(nomeProjetoEdicao));
         Assert.AreEqual(1, ProjetoDBSteps.VerificaProjetoExiste(nomeProjetoNovo));
     });
 }