Esempio n. 1
0
        public void QueryNextAsyncNull()
        {
            var response = new QueryNextResponse();
            var channel  = new TestRequestChannel(response);

            channel.Invoking(c => c.QueryNextAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Esempio n. 2
0
        public async Task QueryNextAsync()
        {
            var response = new QueryNextResponse();
            var request  = new QueryNextRequest();
            var channel  = new TestRequestChannel(response);

            var ret = await channel.QueryNextAsync(request);

            ret
            .Should().BeSameAs(response);

            channel.Request
            .Should().BeSameAs(request);
        }
Esempio n. 3
0
        /// <summary>
        /// Invokes the QueryNext service.
        /// </summary>
        public IServiceResponse QueryNext(IServiceRequest incoming)
        {
            QueryNextResponse response = null;

            QueryNextRequest request = (QueryNextRequest)incoming;

            QueryDataSetCollection queryDataSets = null;
            byte[] revisedContinuationPoint = null;

            response = new QueryNextResponse();

            response.ResponseHeader = ServerInstance.QueryNext(
               request.RequestHeader,
               request.ReleaseContinuationPoint,
               request.ContinuationPoint,
               out queryDataSets,
               out revisedContinuationPoint);

            response.QueryDataSets            = queryDataSets;
            response.RevisedContinuationPoint = revisedContinuationPoint;

            return response;
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public QueryNextResponseMessage(ServiceFault ServiceFault)
        {
            this.QueryNextResponse = new QueryNextResponse();

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

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

            return new QueryNextResponseMessage(body);
        }