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