Beispiel #1
0
        public void List()
        {
            moq::Mock <RegionTargetHttpProxies.RegionTargetHttpProxiesClient> mockGrpcClient = new moq::Mock <RegionTargetHttpProxies.RegionTargetHttpProxiesClient>(moq::MockBehavior.Strict);
            ListRegionTargetHttpProxiesRequest request = new ListRegionTargetHttpProxiesRequest
            {
                Region  = "regionedb20d96",
                Project = "projectaa6ff846",
            };
            TargetHttpProxyList expectedResponse = new TargetHttpProxyList
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new TargetHttpProxy(),
                },
                SelfLink = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.List(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RegionTargetHttpProxiesClient client   = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null);
            TargetHttpProxyList           response = client.List(request.Project, request.Region);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public void ListRequestObject()
        {
            moq::Mock <RegionTargetHttpProxies.RegionTargetHttpProxiesClient> mockGrpcClient = new moq::Mock <RegionTargetHttpProxies.RegionTargetHttpProxiesClient>(moq::MockBehavior.Strict);
            ListRegionTargetHttpProxiesRequest request = new ListRegionTargetHttpProxiesRequest
            {
                PageToken            = "page_tokenf09e5538",
                MaxResults           = 2806814450U,
                Filter               = "filtere47ac9b2",
                Region               = "regionedb20d96",
                OrderBy              = "order_byb4d33ada",
                Project              = "projectaa6ff846",
                ReturnPartialSuccess = false,
            };
            TargetHttpProxyList expectedResponse = new TargetHttpProxyList
            {
                Id            = "id74b70bb8",
                Kind          = "kindf7aa39d9",
                Warning       = new Warning(),
                NextPageToken = "next_page_tokendbee0940",
                Items         =
                {
                    new TargetHttpProxy(),
                },
                SelfLink = "self_link7e87f12d",
            };

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

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