public MockSet<ConsultarServicoNaoElegivelClienteRequest, ConsultarServicoNaoElegivelClienteResponse> GetMocksetforCustomer(long codigoCliente, string[] codigosServicos)
        {
            var request = new ConsultarServicoNaoElegivelClienteRequest()
            {
                CodigoCliente = codigoCliente
            };

            var response = new ConsultarServicoNaoElegivelClienteResponse();
            response.Status = ExecutionStatus.Success;

            response.Servicos = new List<ConsultarServicoNaoElegivelClienteServicoDTO>();

            if (codigosServicos != null)
            {
                var servicos = from servico in GetFullServiceList()
                               where codigosServicos.Contains(servico.CodigoServico)
                               select servico;

                response.Servicos.AddRange(servicos);
            }
            else
            {
                response.Servicos.AddRange(GetFullServiceList());
            }

            response.NumeroTotalRegistros = response.Servicos.Count;

            var mockSet = new MockSet<ConsultarServicoNaoElegivelClienteRequest, ConsultarServicoNaoElegivelClienteResponse>();
            mockSet.request = request;
            mockSet.response = response;

            return mockSet;
        }
        public void BLSuccesso()
        {
            var request = new ConsultarServicoNaoElegivelClienteRequest()
            {
                CodigoCliente = 10011001,
                UserId = new Guid("be12ef3a-000f-e511-80c0-00155d0ef405")
                
            };

            var business = new ConsultarServicoNaoElegivelClienteBL();
            
            var response = business.Execute(request);

            Assert.AreEqual(true, response.Status);
        }
Пример #3
0
 public ConsultarServicoNaoElegivelClienteResponse ConsultarServicoNaoElegivelCliente(ConsultarServicoNaoElegivelClienteRequest requestData)
 {
     var business = new ConsultarServicoNaoElegivelClienteBL();
     var response = this.ExecuteBusiness(business, requestData);
     return response;
 }
        //Mockset Error Loading
        public MockSet<ConsultarServicoNaoElegivelClienteRequest, ConsultarServicoNaoElegivelClienteResponse> GetMocksetforCustomerErrorLoading(long codigoCliente_, string[] codigosServicos_)
        {
            var request = new ConsultarServicoNaoElegivelClienteRequest()
            {
                CodigoCliente = codigoCliente_
            };

            var response = new ConsultarServicoNaoElegivelClienteResponse();
            response.Status = Cielo.Sirius.Foundation.ExecutionStatus.TechnicalError;
            response.ErrorCode = "Loading";
            response.ErrorMessage = "Ocorreu um erro e não foi possível realizar a operação \n- ob5le375-4f32-4ddo-ab8c-l96b8b2c72cd \n- 10/08/2015 11:23:40";

            response.Servicos = new List<ConsultarServicoNaoElegivelClienteServicoDTO>();

            if (codigosServicos_ != null)
            {
                var servicos = from servico in GetFullServiceList()
                               where codigosServicos_.Contains(servico.CodigoServico)
                               select servico;

                response.Servicos.AddRange(servicos);
            }
            else
            {
                response.Servicos.AddRange(GetFullServiceList());
            }

            response.NumeroTotalRegistros = response.Servicos.Count;

            var mockSet = new MockSet<ConsultarServicoNaoElegivelClienteRequest, ConsultarServicoNaoElegivelClienteResponse>();
            mockSet.request = request;
            mockSet.response = response;

            return mockSet;
        }