/// <summary>Snippet for Method1</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void Method1ResourceNames()
 {
     // Create client
     ResourceNameSeparatorClient resourceNameSeparatorClient = ResourceNameSeparatorClient.Create();
     // Initialize request argument(s)
     RequestName name = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]");
     RequestName @ref = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]");
     // Make the request
     Response response = resourceNameSeparatorClient.Method1(name, @ref);
 }
 /// <summary>Snippet for Method1</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void Method1RequestObject()
 {
     // Create client
     ResourceNameSeparatorClient resourceNameSeparatorClient = ResourceNameSeparatorClient.Create();
     // Initialize request argument(s)
     Request request = new Request
     {
         RequestName      = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
         RefAsRequestName = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
     };
     // Make the request
     Response response = resourceNameSeparatorClient.Method1(request);
 }
        /// <summary>Snippet for Method1Async</summary>
        public async Task Method1ResourceNamesAsync()
        {
            // Snippet: Method1Async(RequestName, RequestName, CallSettings)
            // Additional: Method1Async(RequestName, RequestName, CancellationToken)
            // Create client
            ResourceNameSeparatorClient resourceNameSeparatorClient = await ResourceNameSeparatorClient.CreateAsync();

            // Initialize request argument(s)
            RequestName name = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]");
            RequestName @ref = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]");
            // Make the request
            Response response = await resourceNameSeparatorClient.Method1Async(name, @ref);

            // End snippet
        }
Ejemplo n.º 4
0
        public void Method1()
        {
            moq::Mock <ResourceNameSeparator.ResourceNameSeparatorClient> mockGrpcClient = new moq::Mock <ResourceNameSeparator.ResourceNameSeparatorClient>(moq::MockBehavior.Strict);
            Request request = new Request
            {
                RequestName      = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
                RefAsRequestName = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
            };
            Response expectedResponse = new Response {
            };

            mockGrpcClient.Setup(x => x.Method1(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ResourceNameSeparatorClient client = new ResourceNameSeparatorClientImpl(mockGrpcClient.Object, null, null);
            Response response = client.Method1(request.Name, request.Ref);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 5
0
        public async stt::Task Method1Async()
        {
            moq::Mock <ResourceNameSeparator.ResourceNameSeparatorClient> mockGrpcClient = new moq::Mock <ResourceNameSeparator.ResourceNameSeparatorClient>(moq::MockBehavior.Strict);
            Request request = new Request
            {
                RequestName      = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
                RefAsRequestName = RequestName.FromItemAItemBDetailsADetailsBDetailsCExtra("[ITEM_A_ID]", "[ITEM_B_ID]", "[DETAILS_A_ID]", "[DETAILS_B_ID]", "[DETAILS_C_ID]", "[EXTRA_ID]"),
            };
            Response expectedResponse = new Response {
            };

            mockGrpcClient.Setup(x => x.Method1Async(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Response>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ResourceNameSeparatorClient client = new ResourceNameSeparatorClientImpl(mockGrpcClient.Object, null, null);
            Response responseCallSettings      = await client.Method1Async(request.Name, request.Ref, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Response responseCancellationToken = await client.Method1Async(request.Name, request.Ref, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }