Beispiel #1
0
        public async stt::Task MutateKeywordPlanNegativeKeywordsAsync()
        {
            moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict);
            MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new KeywordPlanNegativeKeywordOperation(),
                },
            };
            MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse
            {
                Results =
                {
                    new MutateKeywordPlanNegativeKeywordResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public void MutateKeywordPlanNegativeKeywords()
        {
            moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(moq::MockBehavior.Strict);
            MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new KeywordPlanNegativeKeywordOperation(),
                },
            };
            MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse
            {
                Results =
                {
                    new MutateKeywordPlanNegativeKeywordResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywords(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            KeywordPlanNegativeKeywordServiceClient   client   = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlanNegativeKeywordsResponse response = client.MutateKeywordPlanNegativeKeywords(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #3
0
        public void MutateKeywordPlanNegativeKeywords3()
        {
            Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict);
            MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywords(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            KeywordPlanNegativeKeywordServiceClient   client   = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlanNegativeKeywordsResponse response = client.MutateKeywordPlanNegativeKeywords(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #4
0
        public async Task MutateKeywordPlanNegativeKeywordsAsync3()
        {
            Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict);
            MutateKeywordPlanNegativeKeywordsRequest request = new MutateKeywordPlanNegativeKeywordsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywordsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanNegativeKeywordsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            KeywordPlanNegativeKeywordServiceClient   client   = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null);
            MutateKeywordPlanNegativeKeywordsResponse response = await client.MutateKeywordPlanNegativeKeywordsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #5
0
        public async Task MutateKeywordPlanNegativeKeywordsAsync()
        {
            Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient> mockGrpcClient = new Mock <KeywordPlanNegativeKeywordService.KeywordPlanNegativeKeywordServiceClient>(MockBehavior.Strict);
            MutateKeywordPlanNegativeKeywordsRequest expectedRequest = new MutateKeywordPlanNegativeKeywordsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateKeywordPlanNegativeKeywordsResponse expectedResponse = new MutateKeywordPlanNegativeKeywordsResponse();

            mockGrpcClient.Setup(x => x.MutateKeywordPlanNegativeKeywordsAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanNegativeKeywordsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            KeywordPlanNegativeKeywordServiceClient client = new KeywordPlanNegativeKeywordServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            IEnumerable <KeywordPlanNegativeKeywordOperation> operations = new List <KeywordPlanNegativeKeywordOperation>();
            bool partialFailure = true;
            bool validateOnly   = false;
            MutateKeywordPlanNegativeKeywordsResponse response = await client.MutateKeywordPlanNegativeKeywordsAsync(customerId, operations, partialFailure, validateOnly);

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