Beispiel #1
0
        public async stt::Task ListAlertFeedbackRequestObjectAsync()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            ListAlertFeedbackRequest request = new ListAlertFeedbackRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
                Filter     = "filtere47ac9b2",
            };
            ListAlertFeedbackResponse expectedResponse = new ListAlertFeedbackResponse
            {
                Feedback =
                {
                    new AlertFeedback(),
                },
            };

            mockGrpcClient.Setup(x => x.ListAlertFeedbackAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListAlertFeedbackResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AlertCenterServiceClient  client = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            ListAlertFeedbackResponse responseCallSettings = await client.ListAlertFeedbackAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ListAlertFeedbackResponse responseCancellationToken = await client.ListAlertFeedbackAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for ListAlertFeedback</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListAlertFeedbackRequestObject()
 {
     // Create client
     AlertCenterServiceClient alertCenterServiceClient = AlertCenterServiceClient.Create();
     // Initialize request argument(s)
     ListAlertFeedbackRequest request = new ListAlertFeedbackRequest
     {
         CustomerId = "",
         AlertId    = "",
         Filter     = "",
     };
     // Make the request
     ListAlertFeedbackResponse response = alertCenterServiceClient.ListAlertFeedback(request);
 }
        /// <summary>Snippet for ListAlertFeedbackAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListAlertFeedbackRequestObjectAsync()
        {
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListAlertFeedbackRequest request = new ListAlertFeedbackRequest
            {
                CustomerId = "",
                AlertId    = "",
                Filter     = "",
            };
            // Make the request
            ListAlertFeedbackResponse response = await alertCenterServiceClient.ListAlertFeedbackAsync(request);
        }
        /// <summary>Snippet for ListAlertFeedbackAsync</summary>
        public async Task ListAlertFeedbackRequestObjectAsync()
        {
            // Snippet: ListAlertFeedbackAsync(ListAlertFeedbackRequest, CallSettings)
            // Additional: ListAlertFeedbackAsync(ListAlertFeedbackRequest, CancellationToken)
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListAlertFeedbackRequest request = new ListAlertFeedbackRequest
            {
                CustomerId = "",
                AlertId    = "",
                Filter     = "",
            };
            // Make the request
            ListAlertFeedbackResponse response = await alertCenterServiceClient.ListAlertFeedbackAsync(request);

            // End snippet
        }
Beispiel #5
0
        public void ListAlertFeedbackRequestObject()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            ListAlertFeedbackRequest request = new ListAlertFeedbackRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    = "alert_idc6c58cd5",
                Filter     = "filtere47ac9b2",
            };
            ListAlertFeedbackResponse expectedResponse = new ListAlertFeedbackResponse
            {
                Feedback =
                {
                    new AlertFeedback(),
                },
            };

            mockGrpcClient.Setup(x => x.ListAlertFeedback(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlertCenterServiceClient  client   = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            ListAlertFeedbackResponse response = client.ListAlertFeedback(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }