public async stt::Task BatchUpdateRowsRequestObjectAsync() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); BatchUpdateRowsRequest request = new BatchUpdateRowsRequest { Parent = "parent7858e4d0", Requests = { new UpdateRowRequest(), }, }; BatchUpdateRowsResponse expectedResponse = new BatchUpdateRowsResponse { Rows = { new Row(), }, }; mockGrpcClient.Setup(x => x.BatchUpdateRowsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <BatchUpdateRowsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); BatchUpdateRowsResponse responseCallSettings = await client.BatchUpdateRowsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); BatchUpdateRowsResponse responseCancellationToken = await client.BatchUpdateRowsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for BatchUpdateRows</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void BatchUpdateRowsRequestObject() { // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) BatchUpdateRowsRequest request = new BatchUpdateRowsRequest { Parent = "", Requests = { new UpdateRowRequest(), }, }; // Make the request BatchUpdateRowsResponse response = tablesServiceClient.BatchUpdateRows(request); }
/// <summary>Snippet for BatchUpdateRowsAsync</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 BatchUpdateRowsRequestObjectAsync() { // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) BatchUpdateRowsRequest request = new BatchUpdateRowsRequest { Parent = "", Requests = { new UpdateRowRequest(), }, }; // Make the request BatchUpdateRowsResponse response = await tablesServiceClient.BatchUpdateRowsAsync(request); }
/// <summary>Snippet for BatchUpdateRowsAsync</summary> public async Task BatchUpdateRowsRequestObjectAsync() { // Snippet: BatchUpdateRowsAsync(BatchUpdateRowsRequest, CallSettings) // Additional: BatchUpdateRowsAsync(BatchUpdateRowsRequest, CancellationToken) // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) BatchUpdateRowsRequest request = new BatchUpdateRowsRequest { Parent = "", Requests = { new UpdateRowRequest(), }, }; // Make the request BatchUpdateRowsResponse response = await tablesServiceClient.BatchUpdateRowsAsync(request); // End snippet }
public void BatchUpdateRowsRequestObject() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); BatchUpdateRowsRequest request = new BatchUpdateRowsRequest { Parent = "parent7858e4d0", Requests = { new UpdateRowRequest(), }, }; BatchUpdateRowsResponse expectedResponse = new BatchUpdateRowsResponse { Rows = { new Row(), }, }; mockGrpcClient.Setup(x => x.BatchUpdateRows(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); BatchUpdateRowsResponse response = client.BatchUpdateRows(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }