public async stt::Task CreateRowAsync()
        {
            moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict);
            CreateRowRequest request = new CreateRowRequest
            {
                Parent = "parent7858e4d0",
                Row    = new Row(),
            };
            Row expectedResponse = new Row
            {
                RowName = RowName.FromTableRow("[TABLE]", "[ROW]"),
                Values  =
                {
                    {
                        "key8a0b6e3c",
                        new wkt::Value()
                    },
                },
            };

            mockGrpcClient.Setup(x => x.CreateRowAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Row>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null);
            Row responseCallSettings   = await client.CreateRowAsync(request.Parent, request.Row, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Row responseCancellationToken = await client.CreateRowAsync(request.Parent, request.Row, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void CreateRow()
        {
            moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict);
            CreateRowRequest request = new CreateRowRequest
            {
                Parent = "parent7858e4d0",
                Row    = new Row(),
            };
            Row expectedResponse = new Row
            {
                RowName = RowName.FromTableRow("[TABLE]", "[ROW]"),
                Values  =
                {
                    {
                        "key8a0b6e3c",
                        new wkt::Value()
                    },
                },
            };

            mockGrpcClient.Setup(x => x.CreateRow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null);
            Row response = client.CreateRow(request.Parent, request.Row);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #3
0
        public void Creates_row_request()
        {
            var request = new CreateRowRequest(new AtsTable("A"), new TableEntity());

            AssertOperationType(request.Operation, TableOperationType.Insert);
            AssertName(request);
        }
 /// <summary>Snippet for CreateRow</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void CreateRowRequestObject()
 {
     // Create client
     TablesServiceClient tablesServiceClient = TablesServiceClient.Create();
     // Initialize request argument(s)
     CreateRowRequest request = new CreateRowRequest
     {
         Parent = "",
         Row    = new Row(),
         View   = View.Unspecified,
     };
     // Make the request
     Row response = tablesServiceClient.CreateRow(request);
 }
예제 #5
0
        /// <summary>Snippet for CreateRowAsync</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 CreateRowRequestObjectAsync()
        {
            // Create client
            TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync();

            // Initialize request argument(s)
            CreateRowRequest request = new CreateRowRequest
            {
                Parent = "",
                Row    = new Row(),
                View   = View.Unspecified,
            };
            // Make the request
            Row response = await tablesServiceClient.CreateRowAsync(request);
        }
예제 #6
0
        /// <summary>Snippet for CreateRowAsync</summary>
        public async Task CreateRowRequestObjectAsync()
        {
            // Snippet: CreateRowAsync(CreateRowRequest, CallSettings)
            // Additional: CreateRowAsync(CreateRowRequest, CancellationToken)
            // Create client
            TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync();

            // Initialize request argument(s)
            CreateRowRequest request = new CreateRowRequest
            {
                Parent = "",
                Row    = new Row(),
                View   = View.Unspecified,
            };
            // Make the request
            Row response = await tablesServiceClient.CreateRowAsync(request);

            // End snippet
        }