Пример #1
0
        public void List()
        {
            moq::Mock <AcceleratorTypes.AcceleratorTypesClient> mockGrpcClient = new moq::Mock <AcceleratorTypes.AcceleratorTypesClient>(moq::MockBehavior.Strict);
            ListAcceleratorTypesRequest request = new ListAcceleratorTypesRequest
            {
                Zone    = "zone255f4ea8",
                Project = "projectaa6ff846",
            };
            AcceleratorTypeList expectedResponse = new AcceleratorTypeList
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new AcceleratorType(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.List(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AcceleratorTypesClient client   = new AcceleratorTypesClientImpl(mockGrpcClient.Object, null);
            AcceleratorTypeList    response = client.List(request.Project, request.Zone);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #2
0
        public async stt::Task ListAsync()
        {
            moq::Mock <AcceleratorTypes.AcceleratorTypesClient> mockGrpcClient = new moq::Mock <AcceleratorTypes.AcceleratorTypesClient>(moq::MockBehavior.Strict);
            ListAcceleratorTypesRequest request = new ListAcceleratorTypesRequest
            {
                Zone    = "zone255f4ea8",
                Project = "projectaa6ff846",
            };
            AcceleratorTypeList expectedResponse = new AcceleratorTypeList
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new AcceleratorType(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.ListAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <AcceleratorTypeList>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AcceleratorTypesClient client = new AcceleratorTypesClientImpl(mockGrpcClient.Object, null);
            AcceleratorTypeList    responseCallSettings = await client.ListAsync(request.Project, request.Zone, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            AcceleratorTypeList responseCancellationToken = await client.ListAsync(request.Project, request.Zone, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Пример #3
0
        public void ListRequestObject()
        {
            moq::Mock <AcceleratorTypes.AcceleratorTypesClient> mockGrpcClient = new moq::Mock <AcceleratorTypes.AcceleratorTypesClient>(moq::MockBehavior.Strict);
            ListAcceleratorTypesRequest request = new ListAcceleratorTypesRequest
            {
                Zone                 = "zone255f4ea8",
                PageToken            = "page_tokenf09e5538",
                MaxResults           = 2806814450U,
                OrderBy              = "order_byb4d33ada",
                Project              = "projectaa6ff846",
                Filter               = "filtere47ac9b2",
                ReturnPartialSuccess = false,
            };
            AcceleratorTypeList expectedResponse = new AcceleratorTypeList
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new AcceleratorType(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.List(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AcceleratorTypesClient client   = new AcceleratorTypesClientImpl(mockGrpcClient.Object, null);
            AcceleratorTypeList    response = client.List(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #4
0
 /// <summary>Snippet for List</summary>
 public void List()
 {
     // Snippet: List(string, string, CallSettings)
     // Create client
     AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.Create();
     // Initialize request argument(s)
     string project = "";
     string zone    = "";
     // Make the request
     AcceleratorTypeList response = acceleratorTypesClient.List(project, zone);
     // End snippet
 }
Пример #5
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, CallSettings)
            // Additional: ListAsync(string, string, CancellationToken)
            // Create client
            AcceleratorTypesClient acceleratorTypesClient = await AcceleratorTypesClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string zone    = "";
            // Make the request
            AcceleratorTypeList response = await acceleratorTypesClient.ListAsync(project, zone);

            // End snippet
        }
Пример #6
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListAcceleratorTypesRequest, CallSettings)
     // Create client
     AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.Create();
     // Initialize request argument(s)
     ListAcceleratorTypesRequest request = new ListAcceleratorTypesRequest
     {
         Zone                 = "",
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     AcceleratorTypeList response = acceleratorTypesClient.List(request);
     // End snippet
 }
Пример #7
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListAcceleratorTypesRequest, CallSettings)
            // Additional: ListAsync(ListAcceleratorTypesRequest, CancellationToken)
            // Create client
            AcceleratorTypesClient acceleratorTypesClient = await AcceleratorTypesClient.CreateAsync();

            // Initialize request argument(s)
            ListAcceleratorTypesRequest request = new ListAcceleratorTypesRequest
            {
                Zone                 = "",
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            AcceleratorTypeList response = await acceleratorTypesClient.ListAsync(request);

            // End snippet
        }