Пример #1
0
        public async stt::Task GetFlowValidationResultResourceNamesAsync()
        {
            moq::Mock <Flows.FlowsClient> mockGrpcClient = new moq::Mock <Flows.FlowsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetFlowValidationResultRequest request = new GetFlowValidationResultRequest
            {
                FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
            };
            FlowValidationResult expectedResponse = new FlowValidationResult
            {
                FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                ValidationMessages       =
                {
                    new ValidationMessage(),
                },
                UpdateTime = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.GetFlowValidationResultAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <FlowValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            FlowsClient          client = new FlowsClientImpl(mockGrpcClient.Object, null);
            FlowValidationResult responseCallSettings = await client.GetFlowValidationResultAsync(request.FlowValidationResultName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            FlowValidationResult responseCancellationToken = await client.GetFlowValidationResultAsync(request.FlowValidationResultName, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Пример #2
0
        public void GetFlowValidationResultResourceNames()
        {
            moq::Mock <Flows.FlowsClient> mockGrpcClient = new moq::Mock <Flows.FlowsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetFlowValidationResultRequest request = new GetFlowValidationResultRequest
            {
                FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
            };
            FlowValidationResult expectedResponse = new FlowValidationResult
            {
                FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                ValidationMessages       =
                {
                    new ValidationMessage(),
                },
                UpdateTime = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.GetFlowValidationResult(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FlowsClient          client   = new FlowsClientImpl(mockGrpcClient.Object, null);
            FlowValidationResult response = client.GetFlowValidationResult(request.FlowValidationResultName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #3
0
 /// <summary>Snippet for GetFlowValidationResult</summary>
 public void GetFlowValidationResultResourceNames()
 {
     // Snippet: GetFlowValidationResult(FlowValidationResultName, CallSettings)
     // Create client
     FlowsClient flowsClient = FlowsClient.Create();
     // Initialize request argument(s)
     FlowValidationResultName name = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
     // Make the request
     FlowValidationResult response = flowsClient.GetFlowValidationResult(name);
     // End snippet
 }
Пример #4
0
        /// <summary>Snippet for GetFlowValidationResultAsync</summary>
        public async Task GetFlowValidationResultResourceNamesAsync()
        {
            // Snippet: GetFlowValidationResultAsync(FlowValidationResultName, CallSettings)
            // Additional: GetFlowValidationResultAsync(FlowValidationResultName, CancellationToken)
            // Create client
            FlowsClient flowsClient = await FlowsClient.CreateAsync();

            // Initialize request argument(s)
            FlowValidationResultName name = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
            // Make the request
            FlowValidationResult response = await flowsClient.GetFlowValidationResultAsync(name);

            // End snippet
        }
Пример #5
0
 /// <summary>Snippet for GetFlowValidationResult</summary>
 public void GetFlowValidationResultRequestObject()
 {
     // Snippet: GetFlowValidationResult(GetFlowValidationResultRequest, CallSettings)
     // Create client
     FlowsClient flowsClient = FlowsClient.Create();
     // Initialize request argument(s)
     GetFlowValidationResultRequest request = new GetFlowValidationResultRequest
     {
         FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
         LanguageCode             = "",
     };
     // Make the request
     FlowValidationResult response = flowsClient.GetFlowValidationResult(request);
     // End snippet
 }
Пример #6
0
        /// <summary>Snippet for GetFlowValidationResultAsync</summary>
        public async Task GetFlowValidationResultRequestObjectAsync()
        {
            // Snippet: GetFlowValidationResultAsync(GetFlowValidationResultRequest, CallSettings)
            // Additional: GetFlowValidationResultAsync(GetFlowValidationResultRequest, CancellationToken)
            // Create client
            FlowsClient flowsClient = await FlowsClient.CreateAsync();

            // Initialize request argument(s)
            GetFlowValidationResultRequest request = new GetFlowValidationResultRequest
            {
                FlowValidationResultName = FlowValidationResultName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                LanguageCode             = "",
            };
            // Make the request
            FlowValidationResult response = await flowsClient.GetFlowValidationResultAsync(request);

            // End snippet
        }