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

            channel.Invoking(c => c.QueryNextAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Exemplo 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);
        }
Exemplo 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;
        }
Exemplo 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;
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes the message with the body.
 /// </summary>
 public QueryNextResponseMessage(QueryNextResponse QueryNextResponse)
 {
     this.QueryNextResponse = QueryNextResponse;
 }
Exemplo 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);
        }