Ejemplo n.º 1
0
 /// <summary>Snippet for GenerateConsistencyToken</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateConsistencyTokenRequestObject()
 {
     // Create client
     BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
     // Initialize request argument(s)
     GenerateConsistencyTokenRequest request = new GenerateConsistencyTokenRequest
     {
         TableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"),
     };
     // Make the request
     GenerateConsistencyTokenResponse response = bigtableTableAdminClient.GenerateConsistencyToken(request);
 }
Ejemplo n.º 2
0
 /// <summary>Snippet for GenerateConsistencyToken</summary>
 public void GenerateConsistencyToken_RequestObject()
 {
     // Snippet: GenerateConsistencyToken(GenerateConsistencyTokenRequest,CallSettings)
     // Create client
     BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
     // Initialize request argument(s)
     GenerateConsistencyTokenRequest request = new GenerateConsistencyTokenRequest
     {
         TableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]"),
     };
     // Make the request
     GenerateConsistencyTokenResponse response = bigtableTableAdminClient.GenerateConsistencyToken(request);
     // End snippet
 }
        /// <summary>Snippet for GenerateConsistencyTokenAsync</summary>
        public async Task GenerateConsistencyTokenAsync_RequestObject()
        {
            // Snippet: GenerateConsistencyTokenAsync(GenerateConsistencyTokenRequest,CallSettings)
            // Additional: GenerateConsistencyTokenAsync(GenerateConsistencyTokenRequest,CancellationToken)
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            GenerateConsistencyTokenRequest request = new GenerateConsistencyTokenRequest
            {
                TableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]"),
            };
            // Make the request
            GenerateConsistencyTokenResponse response = await bigtableTableAdminClient.GenerateConsistencyTokenAsync(request);

            // End snippet
        }
Ejemplo n.º 4
0
        public async Task GenerateConsistencyTokenAsync2()
        {
            Mock <BigtableTableAdmin.BigtableTableAdminClient> mockGrpcClient = new Mock <BigtableTableAdmin.BigtableTableAdminClient>(MockBehavior.Strict);
            GenerateConsistencyTokenRequest request = new GenerateConsistencyTokenRequest
            {
                TableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]"),
            };
            GenerateConsistencyTokenResponse expectedResponse = new GenerateConsistencyTokenResponse
            {
                ConsistencyToken = "consistencyToken-1090516718",
            };

            mockGrpcClient.Setup(x => x.GenerateConsistencyTokenAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <GenerateConsistencyTokenResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            BigtableTableAdminClient         client   = new BigtableTableAdminClientImpl(mockGrpcClient.Object, null);
            GenerateConsistencyTokenResponse response = await client.GenerateConsistencyTokenAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 5
0
        public void GenerateConsistencyToken2()
        {
            Mock <BigtableTableAdmin.BigtableTableAdminClient> mockGrpcClient = new Mock <BigtableTableAdmin.BigtableTableAdminClient>(MockBehavior.Strict);
            GenerateConsistencyTokenRequest request = new GenerateConsistencyTokenRequest
            {
                TableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]"),
            };
            GenerateConsistencyTokenResponse expectedResponse = new GenerateConsistencyTokenResponse
            {
                ConsistencyToken = "consistencyToken-1090516718",
            };

            mockGrpcClient.Setup(x => x.GenerateConsistencyToken(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            BigtableTableAdminClient         client   = new BigtableTableAdminClientImpl(mockGrpcClient.Object, null);
            GenerateConsistencyTokenResponse response = client.GenerateConsistencyToken(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }