Exemplo n.º 1
0
        public void CodigoClienteNaoExistente()
        {
            var request = new DesabilitarServicoRequest()
            {
                CodigoCliente = -1,
                CodigoServico = "1"
            };

            var business = new DesabilitarServicoBL();

            var response = business.Execute(request);

            Assert.IsNotNull(response);
            Assert.IsFalse(response.Status == Foundation.ExecutionStatus.Success);
            Assert.AreEqual("9999", response.ErrorCode);
            Assert.AreEqual("RECORD NOT FOUND", response.ErrorMessage);
        }
Exemplo n.º 2
0
        public void TechnicalError()
        {
            var request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 3,
                CodigoServico = "3",
                IlhaDeAtendimento = "Ilha de Atendimento TE",
                TituloDaOcorrencia = "Titulo da Ocorrência TE",
                UserId = new Guid("be12ef3a-000f-e511-80c0-00155d0ef405"),
                CorrelationId = new Guid("be12ef3a-000f-e511-80c0-00155d0ef405")
            };

            var business = new DesabilitarServicoBL();

            var response = business.Execute(request);

            Assert.IsNotNull(response);
            Assert.IsTrue(response.Status == Foundation.ExecutionStatus.TechnicalError);
        }
Exemplo n.º 3
0
        public void DesabServico()
        {
            var request = new DesabilitarServicoRequest()
            {
                CanalDeAtendimento = "CanalDeAtendimentoTest",
                CaseType = "CaseTypeTest",
                Cliente = "ClienteTest",
                CodigoCliente = 10011001,
                CodigoServico = "CodigoServicoTest",
                CorrelationId = new Guid("00000000-0000-0000-0000-000000000000"),
                IlhaDeAtendimento = "IlhaDeAtendimentoTest",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597", //Ocorrencia que criei para testes
                UserId = new Guid("C243440B-1A32-E511-80CE-000D3AC01090")
            };
            var srv = new ProdutosServiceClient();
            var response = srv.DesabilitarServico(request);

            Assert.IsNotNull(response);
            Assert.AreEqual(ExecutionStatus.Success, response.Status);
        }
Exemplo n.º 4
0
 public DesabilitarServicoResponse DesabilitarServico(DesabilitarServicoRequest requestData)
 {
     var business = new DesabilitarServicoBL();
     var response = this.ExecuteBusiness(business, requestData);
     return response;
 }
Exemplo n.º 5
0
        public void BusinessError()
        {
            var mockSets = new List<MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>>();

            var request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "12",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //////SolicitacaoCentralAtendimento //Solicitacao = new //SolicitacaoCentralAtendimento();
            ////Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            ////Solicitacao.Codigo//Solicitacao = 001;

            var response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet2 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet2.request = request;
            mockSet2.response = response;

            mockSets.Add(mockSet2);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "15",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet3 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet3.request = request;
            mockSet3.response = response;

            mockSets.Add(mockSet3);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "18",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet4 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet4.request = request;
            mockSet4.response = response;

            mockSets.Add(mockSet4);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "19",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."  
            };

            var mockSet5 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet5.request = request;
            mockSet5.response = response;

            mockSets.Add(mockSet5);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "20",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet6 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet6.request = request;
            mockSet6.response = response;

            mockSets.Add(mockSet6);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "21",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet7 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet7.request = request;
            mockSet7.response = response;

            mockSets.Add(mockSet7);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "22",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet8 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet8.request = request;
            mockSet8.response = response;

            mockSets.Add(mockSet8);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "23",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet9 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet9.request = request;
            mockSet9.response = response;

            mockSets.Add(mockSet9);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "24",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet10 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet10.request = request;
            mockSet10.response = response;

            mockSets.Add(mockSet10);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "25",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet11 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet11.request = request;
            mockSet11.response = response;

            mockSets.Add(mockSet11);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "26",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet12 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet12.request = request;
            mockSet12.response = response;

            mockSets.Add(mockSet12);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "27",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet13 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet13.request = request;
            mockSet13.response = response;

            mockSets.Add(mockSet13);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "28",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet14 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet14.request = request;
            mockSet14.response = response;

            mockSets.Add(mockSet14);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "29",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet15 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet15.request = request;
            mockSet15.response = response;

            mockSets.Add(mockSet15);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "36",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };

            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."
            };

            var mockSet16 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet16.request = request;
            mockSet16.response = response;

            mockSets.Add(mockSet16);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "37",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607"),
                //Origem = "CRM",
                //Protocolo = "0000222",
            };


            //Solicitacao = new //SolicitacaoCentralAtendimento();
            //Solicitacao.DataPrevistaConclusao//Solicitacao = DateTime.Now;
            //Solicitacao.Codigo//Solicitacao = 001;

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError,
                ErrorMessage = "A integração retornou com erro."

            };

            this.WriteObject(@"..\..\Generated\MockDesabilitarServicoBusinessError.xml", mockSets);
        }
Exemplo n.º 6
0
        public void UnitTest()
        {
            var mockSets = new List<MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>>();

            var request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "12",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607")
            };


            var response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.Success
            };

            var mockSet1 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet1.request = request;
            mockSet1.response = response;

            mockSets.Add(mockSet1);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "15",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607")
            };

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.TechnicalError
            };

            var mockSet2 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet2.request = request;
            mockSet2.response = response;

            mockSets.Add(mockSet2);

            request = new DesabilitarServicoRequest()
            {
                CodigoCliente = 10011001,
                CodigoServico = "18",
                TituloDaOcorrencia = "0000222",
                Cliente = "99367d71-08ad-4aec-8e73-55ae151614f9",
                IlhaDeAtendimento = "ab4d2b05-1a32-e511-80ce-000d3ac01090",
                CanalDeAtendimento = "Telefone",
                CaseType = "Solicitação",
                ArvoreDeAssunto = "Desabilitar Serviço",
                ParentCaseId = "32321b5c-8138-e511-80fa-000d3ac01597",
                IdMotivo = new Guid("ef974b25-553f-e511-80cb-000d3ac00701"),
                IdDemanda = new Guid("0abf8be4-163a-e511-80f3-000d3ac01607")
            };

            response = new DesabilitarServicoResponse()
            {
                Status = ExecutionStatus.BusinessError
            };

            var mockSet3 = new MockSet<DesabilitarServicoRequest, DesabilitarServicoResponse>();
            mockSet3.request = request;
            mockSet3.response = response;

            mockSets.Add(mockSet3);

            this.WriteObject(@"..\..\Generated\MockDesabilitarServicoUnitTest.xml", mockSets);
        }