コード例 #1
0
        /// <summary>Snippet for SendNotificationChannelVerificationCode</summary>
        public void SendNotificationChannelVerificationCode_RequestObject()
        {
            // Snippet: SendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest,CallSettings)
            // Create client
            NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
            // Initialize request argument(s)
            SendNotificationChannelVerificationCodeRequest request = new SendNotificationChannelVerificationCodeRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };

            // Make the request
            notificationChannelServiceClient.SendNotificationChannelVerificationCode(request);
            // End snippet
        }
コード例 #2
0
        public async Task SendNotificationChannelVerificationCodeAsync2()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            SendNotificationChannelVerificationCodeRequest request = new SendNotificationChannelVerificationCodeRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.SendNotificationChannelVerificationCodeAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);
            await client.SendNotificationChannelVerificationCodeAsync(request);

            mockGrpcClient.VerifyAll();
        }
コード例 #3
0
        public void SendNotificationChannelVerificationCode2()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            SendNotificationChannelVerificationCodeRequest request = new SendNotificationChannelVerificationCodeRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.SendNotificationChannelVerificationCode(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);

            client.SendNotificationChannelVerificationCode(request);
            mockGrpcClient.VerifyAll();
        }
コード例 #4
0
        /// <summary>Snippet for SendNotificationChannelVerificationCodeAsync</summary>
        public async Task SendNotificationChannelVerificationCodeAsync_RequestObject()
        {
            // Snippet: SendNotificationChannelVerificationCodeAsync(SendNotificationChannelVerificationCodeRequest,CallSettings)
            // Additional: SendNotificationChannelVerificationCodeAsync(SendNotificationChannelVerificationCodeRequest,CancellationToken)
            // Create client
            NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();

            // Initialize request argument(s)
            SendNotificationChannelVerificationCodeRequest request = new SendNotificationChannelVerificationCodeRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            // Make the request
            await notificationChannelServiceClient.SendNotificationChannelVerificationCodeAsync(request);

            // End snippet
        }