public void MutateConversionValueRuleSets()
        {
            moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient> mockGrpcClient = new moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient>(moq::MockBehavior.Strict);
            MutateConversionValueRuleSetsRequest request = new MutateConversionValueRuleSetsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new ConversionValueRuleSetOperation(),
                },
            };
            MutateConversionValueRuleSetsResponse expectedResponse = new MutateConversionValueRuleSetsResponse
            {
                Results =
                {
                    new MutateConversionValueRuleSetResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateConversionValueRuleSets(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ConversionValueRuleSetServiceClient   client   = new ConversionValueRuleSetServiceClientImpl(mockGrpcClient.Object, null);
            MutateConversionValueRuleSetsResponse response = client.MutateConversionValueRuleSets(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 2
0
        public async stt::Task GetConversionValueRuleSetRequestObjectAsync()
        {
            moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient> mockGrpcClient = new moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient>(moq::MockBehavior.Strict);
            GetConversionValueRuleSetRequest request = new GetConversionValueRuleSetRequest
            {
                ResourceNameAsConversionValueRuleSetName = gagvr::ConversionValueRuleSetName.FromCustomerConversionValueRuleSet("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_SET_ID]"),
            };
            gagvr::ConversionValueRuleSet expectedResponse = new gagvr::ConversionValueRuleSet
            {
                ResourceNameAsConversionValueRuleSetName = gagvr::ConversionValueRuleSetName.FromCustomerConversionValueRuleSet("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_SET_ID]"),
                Id = -6774108720365892680L,
                ConversionValueRulesAsConversionValueRuleNames =
                {
                    gagvr::ConversionValueRuleName.FromCustomerConversionValueRule("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_ID]"),
                },
                Dimensions =
                {
                    gagve::ValueRuleSetDimensionEnum.Types.ValueRuleSetDimension.Unspecified,
                },
                OwnerCustomerAsCustomerName = gagvr::CustomerName.FromCustomer("[CUSTOMER_ID]"),
                AttachmentType         = gagve::ValueRuleSetAttachmentTypeEnum.Types.ValueRuleSetAttachmentType.Unspecified,
                CampaignAsCampaignName = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER_ID]", "[CAMPAIGN_ID]"),
                Status = gagve::ConversionValueRuleSetStatusEnum.Types.ConversionValueRuleSetStatus.Paused,
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateConversionValueRuleSetsRequestObjectAsync()
        {
            moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient> mockGrpcClient = new moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient>(moq::MockBehavior.Strict);
            MutateConversionValueRuleSetsRequest request = new MutateConversionValueRuleSetsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new ConversionValueRuleSetOperation(),
                },
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
                PartialFailure      = false,
            };
            MutateConversionValueRuleSetsResponse expectedResponse = new MutateConversionValueRuleSetsResponse
            {
                Results =
                {
                    new MutateConversionValueRuleSetResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

            Assert.AreEqual(expectedResponse, responseCallSettings);
            MutateConversionValueRuleSetsResponse responseCancellationToken = await client.MutateConversionValueRuleSetsAsync(request, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 4
0
        public void GetConversionValueRuleSetResourceNames()
        {
            moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient> mockGrpcClient = new moq::Mock <ConversionValueRuleSetService.ConversionValueRuleSetServiceClient>(moq::MockBehavior.Strict);
            GetConversionValueRuleSetRequest request = new GetConversionValueRuleSetRequest
            {
                ResourceNameAsConversionValueRuleSetName = gagvr::ConversionValueRuleSetName.FromCustomerConversionValueRuleSet("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_SET_ID]"),
            };
            gagvr::ConversionValueRuleSet expectedResponse = new gagvr::ConversionValueRuleSet
            {
                ResourceNameAsConversionValueRuleSetName = gagvr::ConversionValueRuleSetName.FromCustomerConversionValueRuleSet("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_SET_ID]"),
                Id = -6774108720365892680L,
                ConversionValueRulesAsConversionValueRuleNames =
                {
                    gagvr::ConversionValueRuleName.FromCustomerConversionValueRule("[CUSTOMER_ID]", "[CONVERSION_VALUE_RULE_ID]"),
                },
                Dimensions =
                {
                    gagve::ValueRuleSetDimensionEnum.Types.ValueRuleSetDimension.Unspecified,
                },
                OwnerCustomerAsCustomerName = gagvr::CustomerName.FromCustomer("[CUSTOMER_ID]"),
                AttachmentType         = gagve::ValueRuleSetAttachmentTypeEnum.Types.ValueRuleSetAttachmentType.Unspecified,
                CampaignAsCampaignName = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER_ID]", "[CAMPAIGN_ID]"),
                Status = gagve::ConversionValueRuleSetStatusEnum.Types.ConversionValueRuleSetStatus.Paused,
            };

            mockGrpcClient.Setup(x => x.GetConversionValueRuleSet(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ConversionValueRuleSetServiceClient client   = new ConversionValueRuleSetServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::ConversionValueRuleSet       response = client.GetConversionValueRuleSet(request.ResourceNameAsConversionValueRuleSetName);

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