public async stt::Task GetRemarketingActionRequestObjectAsync()
        {
            moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict);
            GetRemarketingActionRequest request = new GetRemarketingActionRequest
            {
                ResourceNameAsRemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
            };
            gagvr::RemarketingAction expectedResponse = new gagvr::RemarketingAction
            {
                ResourceNameAsRemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
                Id = -6774108720365892680L,
                RemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
                TagSnippets           =
                {
                    new gagvc::TagSnippet(),
                },
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void GetRemarketingAction()
        {
            moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict);
            GetRemarketingActionRequest request = new GetRemarketingActionRequest
            {
                ResourceNameAsRemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
            };
            gagvr::RemarketingAction expectedResponse = new gagvr::RemarketingAction
            {
                ResourceNameAsRemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
                Id = -6774108720365892680L,
                RemarketingActionName = gagvr::RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"),
                TagSnippets           =
                {
                    new gagvc::TagSnippet(),
                },
            };

            mockGrpcClient.Setup(x => x.GetRemarketingAction(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RemarketingActionServiceClient client   = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::RemarketingAction       response = client.GetRemarketingAction(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateRemarketingActions()
        {
            moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict);
            MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new RemarketingActionOperation(),
                },
            };
            MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse
            {
                Results =
                {
                    new MutateRemarketingActionResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateRemarketingActions(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RemarketingActionServiceClient   client   = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            MutateRemarketingActionsResponse response = client.MutateRemarketingActions(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateRemarketingActionsAsync()
        {
            moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict);
            MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new RemarketingActionOperation(),
                },
            };
            MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse
            {
                Results =
                {
                    new MutateRemarketingActionResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
コード例 #5
0
        public async Task MutateRemarketingActionsAsync3()
        {
            Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict);
            MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse();

            mockGrpcClient.Setup(x => x.MutateRemarketingActionsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateRemarketingActionsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            RemarketingActionServiceClient   client   = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            MutateRemarketingActionsResponse response = await client.MutateRemarketingActionsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #6
0
        public void MutateRemarketingActions3()
        {
            Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict);
            MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse();

            mockGrpcClient.Setup(x => x.MutateRemarketingActions(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            RemarketingActionServiceClient   client   = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            MutateRemarketingActionsResponse response = client.MutateRemarketingActions(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #7
0
        public void GetRemarketingAction2()
        {
            Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict);
            GetRemarketingActionRequest request = new GetRemarketingActionRequest
            {
                ResourceName = new RemarketingActionName("[CUSTOMER]", "[REMARKETING_ACTION]").ToString(),
            };
            RemarketingAction expectedResponse = new RemarketingAction
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetRemarketingAction(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            RemarketingAction response            = client.GetRemarketingAction(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #8
0
        public async Task GetRemarketingActionAsync2()
        {
            Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict);
            GetRemarketingActionRequest request = new GetRemarketingActionRequest
            {
                ResourceName = new RemarketingActionName("[CUSTOMER]", "[REMARKETING_ACTION]").ToString(),
            };
            RemarketingAction expectedResponse = new RemarketingAction
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetRemarketingActionAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <RemarketingAction>(Task.FromResult(expectedResponse), null, null, null, null));
            RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null);
            RemarketingAction response            = await client.GetRemarketingActionAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #9
0
        public async Task MutateRemarketingActionsAsync()
        {
            Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict);
            MutateRemarketingActionsRequest expectedRequest = new MutateRemarketingActionsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse();

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

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