public async stt::Task BatchCommitWriteStreamsRequestObjectAsync() { moq::Mock <BigQueryWrite.BigQueryWriteClient> mockGrpcClient = new moq::Mock <BigQueryWrite.BigQueryWriteClient>(moq::MockBehavior.Strict); BatchCommitWriteStreamsRequest request = new BatchCommitWriteStreamsRequest { Parent = "parent7858e4d0", WriteStreams = { "write_streams405973b2", }, }; BatchCommitWriteStreamsResponse expectedResponse = new BatchCommitWriteStreamsResponse { CommitTime = new wkt::Timestamp(), StreamErrors = { new StorageError(), }, }; mockGrpcClient.Setup(x => x.BatchCommitWriteStreamsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <BatchCommitWriteStreamsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); BigQueryWriteClient client = new BigQueryWriteClientImpl(mockGrpcClient.Object, null); BatchCommitWriteStreamsResponse responseCallSettings = await client.BatchCommitWriteStreamsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); BatchCommitWriteStreamsResponse responseCancellationToken = await client.BatchCommitWriteStreamsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for BatchCommitWriteStreams</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void BatchCommitWriteStreamsRequestObject() { // Create client BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.Create(); // Initialize request argument(s) BatchCommitWriteStreamsRequest request = new BatchCommitWriteStreamsRequest { Parent = "", WriteStreams = { "", }, }; // Make the request BatchCommitWriteStreamsResponse response = bigQueryWriteClient.BatchCommitWriteStreams(request); }
/// <summary>Snippet for BatchCommitWriteStreamsAsync</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 BatchCommitWriteStreamsRequestObjectAsync() { // Create client BigQueryWriteClient bigQueryWriteClient = await BigQueryWriteClient.CreateAsync(); // Initialize request argument(s) BatchCommitWriteStreamsRequest request = new BatchCommitWriteStreamsRequest { Parent = "", WriteStreams = { "", }, }; // Make the request BatchCommitWriteStreamsResponse response = await bigQueryWriteClient.BatchCommitWriteStreamsAsync(request); }
/// <summary>Snippet for BatchCommitWriteStreamsAsync</summary> public async Task BatchCommitWriteStreamsRequestObjectAsync() { // Snippet: BatchCommitWriteStreamsAsync(BatchCommitWriteStreamsRequest, CallSettings) // Additional: BatchCommitWriteStreamsAsync(BatchCommitWriteStreamsRequest, CancellationToken) // Create client BigQueryWriteClient bigQueryWriteClient = await BigQueryWriteClient.CreateAsync(); // Initialize request argument(s) BatchCommitWriteStreamsRequest request = new BatchCommitWriteStreamsRequest { Parent = "", WriteStreams = { "", }, }; // Make the request BatchCommitWriteStreamsResponse response = await bigQueryWriteClient.BatchCommitWriteStreamsAsync(request); // End snippet }
public void BatchCommitWriteStreams() { moq::Mock <BigQueryWrite.BigQueryWriteClient> mockGrpcClient = new moq::Mock <BigQueryWrite.BigQueryWriteClient>(moq::MockBehavior.Strict); BatchCommitWriteStreamsRequest request = new BatchCommitWriteStreamsRequest { Parent = "parent7858e4d0", }; BatchCommitWriteStreamsResponse expectedResponse = new BatchCommitWriteStreamsResponse { CommitTime = new wkt::Timestamp(), StreamErrors = { new StorageError(), }, }; mockGrpcClient.Setup(x => x.BatchCommitWriteStreams(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); BigQueryWriteClient client = new BigQueryWriteClientImpl(mockGrpcClient.Object, null); BatchCommitWriteStreamsResponse response = client.BatchCommitWriteStreams(request.Parent); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }