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; }
//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; }
public void ErrorDataBusiness() { var response = new ConsultarServicoNaoElegivelClienteResponse(); response.Status = Cielo.Sirius.Foundation.ExecutionStatus.BusinessError; response.ErrorCode = "007"; response.ErrorMessage = "INVALID ACCOUNT(N-H)"; this.WriteObject(@"..\..\Generated\ConsultarServicoNaoElegivelClienteMockErrorBusiness.xml", response); }