Example #1
0
        public async stt::Task MutateFeedItemSetLinksAsync()
        {
            moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict);
            MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedItemSetLinkOperation(),
                },
            };
            MutateFeedItemSetLinksResponse expectedResponse = new MutateFeedItemSetLinksResponse
            {
                Results =
                {
                    new MutateFeedItemSetLinkResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateFeedItemSetLinksAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateFeedItemSetLinksResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            FeedItemSetLinkServiceClient   client = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedItemSetLinksResponse responseCallSettings = await client.MutateFeedItemSetLinksAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            Assert.AreEqual(expectedResponse, responseCallSettings);
            MutateFeedItemSetLinksResponse responseCancellationToken = await client.MutateFeedItemSetLinksAsync(request.CustomerId, request.Operations, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Example #2
0
        public void MutateFeedItemSetLinks()
        {
            moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict);
            MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedItemSetLinkOperation(),
                },
            };
            MutateFeedItemSetLinksResponse expectedResponse = new MutateFeedItemSetLinksResponse
            {
                Results =
                {
                    new MutateFeedItemSetLinkResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateFeedItemSetLinks(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedItemSetLinkServiceClient   client   = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedItemSetLinksResponse response = client.MutateFeedItemSetLinks(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #3
0
        public void GetFeedItemSetLink()
        {
            moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict);
            GetFeedItemSetLinkRequest request = new GetFeedItemSetLinkRequest
            {
                ResourceNameAsFeedItemSetLinkName = gagvr::FeedItemSetLinkName.FromCustomerFeedFeedItemSetFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]", "[FEED_ITEM_ID]"),
            };
            gagvr::FeedItemSetLink expectedResponse = new gagvr::FeedItemSetLink
            {
                ResourceNameAsFeedItemSetLinkName = gagvr::FeedItemSetLinkName.FromCustomerFeedFeedItemSetFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]", "[FEED_ITEM_ID]"),
                FeedItemAsFeedItemName            = gagvr::FeedItemName.FromCustomerFeedFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_ID]"),
                FeedItemSetAsFeedItemSetName      = gagvr::FeedItemSetName.FromCustomerFeedFeedItemSet("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]"),
            };

            mockGrpcClient.Setup(x => x.GetFeedItemSetLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedItemSetLinkServiceClient client   = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::FeedItemSetLink       response = client.GetFeedItemSetLink(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #4
0
        public async stt::Task GetFeedItemSetLinkRequestObjectAsync()
        {
            moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict);
            GetFeedItemSetLinkRequest request = new GetFeedItemSetLinkRequest
            {
                ResourceNameAsFeedItemSetLinkName = gagvr::FeedItemSetLinkName.FromCustomerFeedFeedItemSetFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]", "[FEED_ITEM_ID]"),
            };
            gagvr::FeedItemSetLink expectedResponse = new gagvr::FeedItemSetLink
            {
                ResourceNameAsFeedItemSetLinkName = gagvr::FeedItemSetLinkName.FromCustomerFeedFeedItemSetFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]", "[FEED_ITEM_ID]"),
                FeedItemAsFeedItemName            = gagvr::FeedItemName.FromCustomerFeedFeedItem("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_ID]"),
                FeedItemSetAsFeedItemSetName      = gagvr::FeedItemSetName.FromCustomerFeedFeedItemSet("[CUSTOMER_ID]", "[FEED_ID]", "[FEED_ITEM_SET_ID]"),
            };

            mockGrpcClient.Setup(x => x.GetFeedItemSetLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::FeedItemSetLink>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            FeedItemSetLinkServiceClient client = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::FeedItemSetLink       responseCallSettings = await client.GetFeedItemSetLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            Assert.AreEqual(expectedResponse, responseCallSettings);
            gagvr::FeedItemSetLink responseCancellationToken = await client.GetFeedItemSetLinkAsync(request, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }