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

            channel.Invoking(c => c.ModifyMonitoredItemsAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Exemplo n.º 2
0
        public async Task ModifyMonitoredItemsAsync()
        {
            var response = new ModifyMonitoredItemsResponse();
            var request  = new ModifyMonitoredItemsRequest();
            var channel  = new TestRequestChannel(response);

            var ret = await channel.ModifyMonitoredItemsAsync(request);

            ret
            .Should().BeSameAs(response);

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

            ModifyMonitoredItemsRequest request = (ModifyMonitoredItemsRequest)incoming;

            MonitoredItemModifyResultCollection results = null;
            DiagnosticInfoCollection diagnosticInfos = null;

            response = new ModifyMonitoredItemsResponse();

            response.ResponseHeader = ServerInstance.ModifyMonitoredItems(
               request.RequestHeader,
               request.SubscriptionId,
               request.TimestampsToReturn,
               request.ItemsToModify,
               out results,
               out diagnosticInfos);

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

            return response;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public ModifyMonitoredItemsResponseMessage(ServiceFault ServiceFault)
        {
            this.ModifyMonitoredItemsResponse = new ModifyMonitoredItemsResponse();

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

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

            return new ModifyMonitoredItemsResponseMessage(body);
        }