public static TransformIvidResponse ForIvid(HpiStandardQueryResponse response)
        {
            var transformer = new TransformIvidResponse(response);

            if (transformer.Continue)
            {
                transformer.Transform();
            }
            return transformer;
        }
        public IvidDataRetriever ThenWithApi(HpiStandardQueryRequest request, IAmDataProvider dataProvider,
            out HpiStandardQueryResponse response)
        {
            if (NoNeedToCallApi)
            {
                response = null;
                return this;
            }

            var webService = new ConfigureIvid();

            _logCommand.LogSecurity(
                new
                {
                    Credentials =
                        new
                        {
                            webService.Client.ClientCredentials.UserName.UserName,
                            webService.Client.ClientCredentials.UserName.Password
                        }
                },
                new {ContextMessage = "Ivid Data Provider Credentials"});

            using (var scope = new OperationContextScope(webService.Client.InnerChannel))
            {
                OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] =
                    webService.RequestMessageProperty;

                _logCommand.LogConfiguration(request, null);
                _logCommand.LogRequest(new ConnectionTypeIdentifier(webService.Client.Endpoint.Address.ToString())
                    .ForWebApiType(), request, dataProvider.BillablleState.NoRecordState);

                response = webService
                    .Client
                    .HpiStandardQuery(request);

                webService.CloseWebService();

                _logCommand.LogResponse(CheckState(response),
                    new ConnectionTypeIdentifier(webService.Client.Endpoint.Address.ToString())
                        .ForWebApiType(), response ?? new HpiStandardQueryResponse(), dataProvider.BillablleState.NoRecordState);

                if (response == null)
                    _logCommand.LogFault(dataProvider,
                        new {NoRequestReceived = "No response received from Ivid Data Provider"});
            }

            return this;
        }
 public when_transforming_ivid_hpi_standard_query_response()
 {
     _ividWebServiceResponse = new SourceResponseBuilder().ForIvid();
 }
 public void CallTheDataProvider(ICollection<IPointToLaceProvider> response)
 {
     _ividResponse = new SourceResponseBuilder().ForIvid();
     TransformResponse(response);
 }
 public TransformIvidResponse(HpiStandardQueryResponse response)
 {
     Continue = response != null;
     Result = Continue ? null : IvidResponse.Empty();
     Message = response;
 }
 private static DataProviderResponseState CheckState(HpiStandardQueryResponse response)
 {
     return response == null
         ? DataProviderResponseState.NoRecords
         : response.partialResponse ? DataProviderResponseState.Partial : DataProviderResponseState.Successful;
 }
 public when_transforming_ivid_response()
 {
     _ividWebServiceResponse = new SourceResponseBuilder().ForIvid();
 }