public void HistoryReadAsyncNull() { var response = new HistoryReadResponse(); var channel = new TestRequestChannel(response); channel.Invoking(c => c.HistoryReadAsync(null)) .Should().Throw <ArgumentNullException>(); }
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); }
/// <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; }
/// <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; } }
/// <summary> /// Initializes the message with the body. /// </summary> public HistoryReadResponseMessage(HistoryReadResponse HistoryReadResponse) { this.HistoryReadResponse = HistoryReadResponse; }
/// <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); }