Esempio n. 1
0
        public void UsuarioNaoPodeSairDoCanalGeral()
        {
            //Parametros
            string channel = "CRMUP910W";

            //Resultados Esperados
            string statusCodeEsperado = "OK";
            string ok    = "False";
            string error = "cant_leave_general";

            //Fluxo

            sairDoCanalRequest = new SairDoCanalRequest(channel);
            sairDoCanalRequest.SetJsonBody(channel);
            IRestResponse <dynamic> response = sairDoCanalRequest.ExecuteRequest();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
                Assert.AreEqual(ok, response.Data["ok"].ToString());
                Assert.AreEqual(error, response.Data["error"].ToString());
            });
        }
Esempio n. 2
0
        public void CanalInvalido()
        {
            //Parametros
            string channel = "ABCDE12";

            //Resultados Esperados
            string statusCodeEsperado = "OK";
            string ok    = "False";
            string error = "channel_not_found";

            //Fluxo

            sairDoCanalRequest = new SairDoCanalRequest(channel);
            sairDoCanalRequest.SetJsonBody(channel);
            IRestResponse <dynamic> response = sairDoCanalRequest.ExecuteRequest();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
                Assert.AreEqual(ok, response.Data["ok"].ToString());
                Assert.AreEqual(error, response.Data["error"].ToString());
            });
        }
Esempio n. 3
0
        public void DadosValidos()
        {
            //Parametros
            string channel = "CRTAQ5N30";
            string name    = "automação";

            //Resultados Esperados
            string statusCodeEsperado = "OK";
            string ok = "True";


            //Fluxo

            IngressarEmUmCanalFlows.IngressarEmUmCanal(name);
            sairDoCanalRequest = new SairDoCanalRequest(channel);
            sairDoCanalRequest.SetJsonBody(channel);
            IRestResponse <dynamic> response = sairDoCanalRequest.ExecuteRequest();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(statusCodeEsperado, response.StatusCode.ToString());
                Assert.AreEqual(ok, response.Data["ok"].ToString());
            });
        }