protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetReferenceRequest request;

            try
            {
                request = new GetReferenceRequest
                {
                    WorkspaceId    = WorkspaceId,
                    ApplicationKey = ApplicationKey,
                    ReferenceKey   = ReferenceKey,
                    OpcRequestId   = OpcRequestId
                };

                response = client.GetReference(request).GetAwaiter().GetResult();
                WriteOutput(response, response.Reference);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
        public void GetReference_Success()
        {
            // Assign
            var xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(IntegrationFixtureBase.GetReferenceResponseXml());
            var expectedResponsePolicyType = xmlDoc.GetElementsByTagName("PolId")[0].InnerText;
            
            IPolicyService subscribeService = new PolicyServiceClient();
            var getReferenceRequest = new GetReferenceRequest {strPolId = "ADF169034A13" };

            // Act
            var actualResponse = subscribeService.GetReference(getReferenceRequest);

            if (actualResponse.GetReferenceResult.ErrorInfo != null)
            {
                _logHandler.WriteLog(actualResponse.GetReferenceResult.ErrorInfo.ErrorXML, LogSeverity.Error,
                                     LogCategory.BusinessComponent);
                _logHandler.WriteLog(actualResponse.GetReferenceResult.ErrorInfo.Description, LogSeverity.Error,
                                     LogCategory.BusinessComponent);
                _logHandler.WriteLog(actualResponse.GetReferenceResult.ErrorInfo.DetailedDescription, LogSeverity.Error,
                                     LogCategory.BusinessComponent);
            }

            Assert.IsNotNull(actualResponse.GetReferenceResult.OutputXml);

            var xmlDoc1 = new XmlDocument();
            xmlDoc1.LoadXml(actualResponse.GetReferenceResult.OutputXml);

            Assert.AreEqual(expectedResponsePolicyType, xmlDoc1.GetElementsByTagName("PolId")[0].InnerText);
        }
        public void GetReference_ErrorReturned()
        {
            // Assign
            IPolicyService subscribeService = new PolicyServiceClient();
            var getReferenceRequest = new GetReferenceRequest();

            // Act
            var actualGetReferenceResponse = subscribeService.GetReference(getReferenceRequest);

            // Assert
            Assert.IsNotNull(actualGetReferenceResponse.GetReferenceResult.ErrorInfo);
        }