예제 #1
0
        public void DeleteSubscriptionsAsyncNull()
        {
            var response = new DeleteSubscriptionsResponse();
            var channel  = new TestRequestChannel(response);

            channel.Invoking(c => c.DeleteSubscriptionsAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
예제 #2
0
        public async Task DeleteSubscriptionsAsync()
        {
            var response = new DeleteSubscriptionsResponse();
            var request  = new DeleteSubscriptionsRequest();
            var channel  = new TestRequestChannel(response);

            var ret = await channel.DeleteSubscriptionsAsync(request);

            ret
            .Should().BeSameAs(response);

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

            DeleteSubscriptionsRequest request = (DeleteSubscriptionsRequest)incoming;

            StatusCodeCollection results = null;
            DiagnosticInfoCollection diagnosticInfos = null;

            response = new DeleteSubscriptionsResponse();

            response.ResponseHeader = ServerInstance.DeleteSubscriptions(
               request.RequestHeader,
               request.SubscriptionIds,
               out results,
               out diagnosticInfos);

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

            return response;
        }
예제 #4
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public DeleteSubscriptionsResponseMessage(ServiceFault ServiceFault)
        {
            this.DeleteSubscriptionsResponse = new DeleteSubscriptionsResponse();

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

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

            return new DeleteSubscriptionsResponseMessage(body);
        }