public async stt::Task MutateAccountLinkRequestObjectAsync() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); MutateAccountLinkRequest request = new MutateAccountLinkRequest { CustomerId = "customer_id3b3724cb", Operation = new AccountLinkOperation(), PartialFailure = false, ValidateOnly = true, }; MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse { Result = new MutateAccountLinkResult(), }; mockGrpcClient.Setup(x => x.MutateAccountLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateAccountLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); MutateAccountLinkResponse responseCallSettings = await client.MutateAccountLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateAccountLinkResponse responseCancellationToken = await client.MutateAccountLinkAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateAccountLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateAccountLink() { // Create client AccountLinkServiceClient accountLinkServiceClient = AccountLinkServiceClient.Create(); // Initialize request argument(s) string customerId = ""; AccountLinkOperation operation = new AccountLinkOperation(); // Make the request MutateAccountLinkResponse response = accountLinkServiceClient.MutateAccountLink(customerId, operation); }
/// <summary>Snippet for MutateAccountLinkAsync</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 MutateAccountLinkAsync() { // Create client AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync(); // Initialize request argument(s) string customerId = ""; AccountLinkOperation operation = new AccountLinkOperation(); // Make the request MutateAccountLinkResponse response = await accountLinkServiceClient.MutateAccountLinkAsync(customerId, operation); }
/// <summary>Snippet for MutateAccountLinkAsync</summary> public async Task MutateAccountLinkAsync() { // Snippet: MutateAccountLinkAsync(string, AccountLinkOperation, CallSettings) // Additional: MutateAccountLinkAsync(string, AccountLinkOperation, CancellationToken) // Create client AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync(); // Initialize request argument(s) string customerId = ""; AccountLinkOperation operation = new AccountLinkOperation(); // Make the request MutateAccountLinkResponse response = await accountLinkServiceClient.MutateAccountLinkAsync(customerId, operation); // End snippet }
/// <summary>Snippet for MutateAccountLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateAccountLinkRequestObject() { // Create client AccountLinkServiceClient accountLinkServiceClient = AccountLinkServiceClient.Create(); // Initialize request argument(s) MutateAccountLinkRequest request = new MutateAccountLinkRequest { CustomerId = "", Operation = new AccountLinkOperation(), PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAccountLinkResponse response = accountLinkServiceClient.MutateAccountLink(request); }
/// <summary>Snippet for MutateAccountLinkAsync</summary> public async Task MutateAccountLinkRequestObjectAsync() { // Snippet: MutateAccountLinkAsync(MutateAccountLinkRequest, CallSettings) // Additional: MutateAccountLinkAsync(MutateAccountLinkRequest, CancellationToken) // Create client AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync(); // Initialize request argument(s) MutateAccountLinkRequest request = new MutateAccountLinkRequest { CustomerId = "", Operation = new AccountLinkOperation(), PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAccountLinkResponse response = await accountLinkServiceClient.MutateAccountLinkAsync(request); // End snippet }
public void MutateAccountLink() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); MutateAccountLinkRequest request = new MutateAccountLinkRequest { CustomerId = "customer_id3b3724cb", Operation = new AccountLinkOperation(), }; MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse { Result = new MutateAccountLinkResult(), }; mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); MutateAccountLinkResponse response = client.MutateAccountLink(request.CustomerId, request.Operation); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateAccountLinkRequestObject() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); MutateAccountLinkRequest request = new MutateAccountLinkRequest { CustomerId = "customer_id3b3724cb", Operation = new AccountLinkOperation(), PartialFailure = false, ValidateOnly = true, }; MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse { Result = new MutateAccountLinkResult(), }; mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); MutateAccountLinkResponse response = client.MutateAccountLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }