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

            var response = new ConsultarServicoElegivelClienteResponse();

            response.Status = ExecutionStatus.Success;

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

            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<ConsultarServicoElegivelClienteRequest, ConsultarServicoElegivelClienteResponse>();
            mockSet.request = request;
            mockSet.response = response;

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

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

            Assert.AreEqual(true, response.Status);
        }
Beispiel #3
0
 public ConsultarServicoElegivelClienteResponse ConsultarServicoElegivelCliente(ConsultarServicoElegivelClienteRequest requestData)
 {
     var business = new ConsultarServicoElegivelClienteBL();
     var response = this.ExecuteBusiness(business, requestData);
     return response;
 }
        //Mockset Error Loading
        public MockSet<ConsultarServicoElegivelClienteRequest, ConsultarServicoElegivelClienteResponse> GetMocksetforCustomerErrorLoading(long codigoCliente_, string[] codigosServicos_)
        {
            var request = new ConsultarServicoElegivelClienteRequest()
            {
                CodigoCliente = codigoCliente_
            };

            var response = new ConsultarServicoElegivelClienteResponse();
            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<ConsultarServicoClienteElegivelServicoDTO>();

            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<ConsultarServicoElegivelClienteRequest, ConsultarServicoElegivelClienteResponse>();
            mockSet.request = request;
            mockSet.response = response;

            return mockSet;
        }