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();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        public void MutateRemarketingActions()
        {
            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.MutateRemarketingActions(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            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 = client.MutateRemarketingActions(customerId, operations, partialFailure, validateOnly);

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