public void GetAdGroupCriterionLabel2()
        {
            Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient> mockGrpcClient = new Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient>(MockBehavior.Strict);
            GetAdGroupCriterionLabelRequest request = new GetAdGroupCriterionLabelRequest
            {
                ResourceName = new AdGroupCriterionLabelName("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]").ToString(),
            };
            AdGroupCriterionLabel expectedResponse = new AdGroupCriterionLabel
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdGroupCriterionLabel(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AdGroupCriterionLabelServiceClient client = new AdGroupCriterionLabelServiceClientImpl(mockGrpcClient.Object, null);
            AdGroupCriterionLabel response            = client.GetAdGroupCriterionLabel(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public void GetAdGroupCriterionLabel()
        {
            moq::Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient> mockGrpcClient = new moq::Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient>(moq::MockBehavior.Strict);
            GetAdGroupCriterionLabelRequest request = new GetAdGroupCriterionLabelRequest
            {
                ResourceNameAsAdGroupCriterionLabelName = gagvr::AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[LABEL_ID]"),
            };
            gagvr::AdGroupCriterionLabel expectedResponse = new gagvr::AdGroupCriterionLabel
            {
                ResourceNameAsAdGroupCriterionLabelName = gagvr::AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[LABEL_ID]"),
                AdGroupCriterionAsAdGroupCriterionName  = gagvr::AdGroupCriterionName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]"),
                LabelAsLabelName = gagvr::LabelName.FromCustomerLabel("[CUSTOMER_ID]", "[LABEL_ID]"),
            };

            mockGrpcClient.Setup(x => x.GetAdGroupCriterionLabel(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AdGroupCriterionLabelServiceClient client   = new AdGroupCriterionLabelServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AdGroupCriterionLabel       response = client.GetAdGroupCriterionLabel(request.ResourceName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }