Пример #1
0
        public void AddNodesAsyncNull()
        {
            var response = new AddNodesResponse();
            var channel  = new TestRequestChannel(response);

            channel.Invoking(c => c.AddNodesAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Пример #2
0
        public async Task AddNodesAsync()
        {
            var response = new AddNodesResponse();
            var request  = new AddNodesRequest();
            var channel  = new TestRequestChannel(response);

            var ret = await channel.AddNodesAsync(request);

            ret
            .Should().BeSameAs(response);

            channel.Request
            .Should().BeSameAs(request);
        }
Пример #3
0
        public static AddNodesResponse Unmarshall(UnmarshallerContext context)
        {
            AddNodesResponse addNodesResponse = new AddNodesResponse();

            addNodesResponse.HttpResponse = context.HttpResponse;
            addNodesResponse.RequestId    = context.StringValue("AddNodes.RequestId");

            List <string> addNodesResponse_instanceIds = new List <string>();

            for (int i = 0; i < context.Length("AddNodes.InstanceIds.Length"); i++)
            {
                addNodesResponse_instanceIds.Add(context.StringValue("AddNodes.InstanceIds[" + i + "]"));
            }
            addNodesResponse.InstanceIds = addNodesResponse_instanceIds;

            return(addNodesResponse);
        }
Пример #4
0
        /// <summary>
        /// Invokes the AddNodes service.
        /// </summary>
        public IServiceResponse AddNodes(IServiceRequest incoming)
        {
            AddNodesResponse response = null;

            AddNodesRequest request = (AddNodesRequest)incoming;

            AddNodesResultCollection results = null;
            DiagnosticInfoCollection diagnosticInfos = null;

            response = new AddNodesResponse();

            response.ResponseHeader = ServerInstance.AddNodes(
               request.RequestHeader,
               request.NodesToAdd,
               out results,
               out diagnosticInfos);

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

            return response;
        }
Пример #5
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public AddNodesResponseMessage(ServiceFault ServiceFault)
        {
            this.AddNodesResponse = new AddNodesResponse();

            if (ServiceFault != null)
            {
                this.AddNodesResponse.ResponseHeader = ServiceFault.ResponseHeader;
            }
        }
Пример #6
0
 /// <summary>
 /// Initializes the message with the body.
 /// </summary>
 public AddNodesResponseMessage(AddNodesResponse AddNodesResponse)
 {
     this.AddNodesResponse = AddNodesResponse;
 }
Пример #7
0
        /// <summary cref="IServiceMessage.CreateResponse" />
        public object CreateResponse(IServiceResponse response)
        {
            AddNodesResponse body = response as AddNodesResponse;

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

            return new AddNodesResponseMessage(body);
        }