Exemple #1
0
        public void HistoryReadAsyncNull()
        {
            var response = new HistoryReadResponse();
            var channel  = new TestRequestChannel(response);

            channel.Invoking(c => c.HistoryReadAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Exemple #2
0
        public async Task HistoryReadAsync()
        {
            var response = new HistoryReadResponse();
            var request  = new HistoryReadRequest();
            var channel  = new TestRequestChannel(response);

            var ret = await channel.HistoryReadAsync(request);

            ret
            .Should().BeSameAs(response);

            channel.Request
            .Should().BeSameAs(request);
        }
Exemple #3
0
        /// <summary>
        /// Invokes the HistoryRead service.
        /// </summary>
        public IServiceResponse HistoryRead(IServiceRequest incoming)
        {
            HistoryReadResponse response = null;

            HistoryReadRequest request = (HistoryReadRequest)incoming;

            HistoryReadResultCollection results = null;
            DiagnosticInfoCollection diagnosticInfos = null;

            response = new HistoryReadResponse();

            response.ResponseHeader = ServerInstance.HistoryRead(
               request.RequestHeader,
               request.HistoryReadDetails,
               request.TimestampsToReturn,
               request.ReleaseContinuationPoints,
               request.NodesToRead,
               out results,
               out diagnosticInfos);

            response.Results         = results;
            response.DiagnosticInfos = diagnosticInfos;

            return response;
        }
Exemple #4
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public HistoryReadResponseMessage(ServiceFault ServiceFault)
        {
            this.HistoryReadResponse = new HistoryReadResponse();

            if (ServiceFault != null)
            {
                this.HistoryReadResponse.ResponseHeader = ServiceFault.ResponseHeader;
            }
        }
Exemple #5
0
 /// <summary>
 /// Initializes the message with the body.
 /// </summary>
 public HistoryReadResponseMessage(HistoryReadResponse HistoryReadResponse)
 {
     this.HistoryReadResponse = HistoryReadResponse;
 }
Exemple #6
0
        /// <summary cref="IServiceMessage.CreateResponse" />
        public object CreateResponse(IServiceResponse response)
        {
            HistoryReadResponse body = response as HistoryReadResponse;

            if (body == null)
            {
                body = new HistoryReadResponse();
                body.ResponseHeader = ((ServiceFault)response).ResponseHeader;
            }

            return new HistoryReadResponseMessage(body);
        }