/// <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 }
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(); }
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(); }
/// <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 }