public async stt::Task ValidateAsync()
        {
            moq::Mock <RegionUrlMaps.RegionUrlMapsClient> mockGrpcClient = new moq::Mock <RegionUrlMaps.RegionUrlMapsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            ValidateRegionUrlMapRequest request = new ValidateRegionUrlMapRequest
            {
                RegionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(),
                Region  = "regionedb20d96",
                Project = "projectaa6ff846",
                UrlMap  = "url_map3ccdbf57",
            };
            UrlMapsValidateResponse expectedResponse = new UrlMapsValidateResponse
            {
                Result = new UrlMapValidationResult(),
            };

            mockGrpcClient.Setup(x => x.ValidateAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <UrlMapsValidateResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            RegionUrlMapsClient     client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null);
            UrlMapsValidateResponse responseCallSettings = await client.ValidateAsync(request.Project, request.Region, request.UrlMap, request.RegionUrlMapsValidateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            UrlMapsValidateResponse responseCancellationToken = await client.ValidateAsync(request.Project, request.Region, request.UrlMap, request.RegionUrlMapsValidateRequestResource, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for Validate</summary>
 public void Validate()
 {
     // Snippet: Validate(string, string, UrlMapsValidateRequest, CallSettings)
     // Create client
     UrlMapsClient urlMapsClient = UrlMapsClient.Create();
     // Initialize request argument(s)
     string project = "";
     string urlMap  = "";
     UrlMapsValidateRequest urlMapsValidateRequestResource = new UrlMapsValidateRequest();
     // Make the request
     UrlMapsValidateResponse response = urlMapsClient.Validate(project, urlMap, urlMapsValidateRequestResource);
     // End snippet
 }
        /// <summary>Snippet for ValidateAsync</summary>
        public async Task ValidateAsync()
        {
            // Snippet: ValidateAsync(string, string, UrlMapsValidateRequest, CallSettings)
            // Additional: ValidateAsync(string, string, UrlMapsValidateRequest, CancellationToken)
            // Create client
            UrlMapsClient urlMapsClient = await UrlMapsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string urlMap  = "";
            UrlMapsValidateRequest urlMapsValidateRequestResource = new UrlMapsValidateRequest();
            // Make the request
            UrlMapsValidateResponse response = await urlMapsClient.ValidateAsync(project, urlMap, urlMapsValidateRequestResource);

            // End snippet
        }
 /// <summary>Snippet for Validate</summary>
 public void ValidateRequestObject()
 {
     // Snippet: Validate(ValidateUrlMapRequest, CallSettings)
     // Create client
     UrlMapsClient urlMapsClient = UrlMapsClient.Create();
     // Initialize request argument(s)
     ValidateUrlMapRequest request = new ValidateUrlMapRequest
     {
         Project = "",
         UrlMap  = "",
         UrlMapsValidateRequestResource = new UrlMapsValidateRequest(),
     };
     // Make the request
     UrlMapsValidateResponse response = urlMapsClient.Validate(request);
     // End snippet
 }
        /// <summary>Snippet for ValidateAsync</summary>
        public async Task ValidateRequestObjectAsync()
        {
            // Snippet: ValidateAsync(ValidateUrlMapRequest, CallSettings)
            // Additional: ValidateAsync(ValidateUrlMapRequest, CancellationToken)
            // Create client
            UrlMapsClient urlMapsClient = await UrlMapsClient.CreateAsync();

            // Initialize request argument(s)
            ValidateUrlMapRequest request = new ValidateUrlMapRequest
            {
                Project = "",
                UrlMap  = "",
                UrlMapsValidateRequestResource = new UrlMapsValidateRequest(),
            };
            // Make the request
            UrlMapsValidateResponse response = await urlMapsClient.ValidateAsync(request);

            // End snippet
        }
Exemplo n.º 6
0
        public void Validate()
        {
            moq::Mock <UrlMaps.UrlMapsClient> mockGrpcClient = new moq::Mock <UrlMaps.UrlMapsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            ValidateUrlMapRequest request = new ValidateUrlMapRequest
            {
                Project = "projectaa6ff846",
                UrlMap  = "url_map3ccdbf57",
                UrlMapsValidateRequestResource = new UrlMapsValidateRequest(),
            };
            UrlMapsValidateResponse expectedResponse = new UrlMapsValidateResponse
            {
                Result = new UrlMapValidationResult(),
            };

            mockGrpcClient.Setup(x => x.Validate(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            UrlMapsClient           client   = new UrlMapsClientImpl(mockGrpcClient.Object, null);
            UrlMapsValidateResponse response = client.Validate(request.Project, request.UrlMap, request.UrlMapsValidateRequestResource);

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