Example #1
0
        public void GetCustomerNegativeCriterion()
        {
            moq::Mock <CustomerNegativeCriterionService.CustomerNegativeCriterionServiceClient> mockGrpcClient = new moq::Mock <CustomerNegativeCriterionService.CustomerNegativeCriterionServiceClient>(moq::MockBehavior.Strict);
            GetCustomerNegativeCriterionRequest request = new GetCustomerNegativeCriterionRequest
            {
                ResourceNameAsCustomerNegativeCriterionName = gagvr::CustomerNegativeCriterionName.FromCustomerCustomerNegativeCriterion("[CUSTOMER]", "[CUSTOMER_NEGATIVE_CRITERION]"),
            };
            gagvr::CustomerNegativeCriterion expectedResponse = new gagvr::CustomerNegativeCriterion
            {
                ResourceNameAsCustomerNegativeCriterionName = gagvr::CustomerNegativeCriterionName.FromCustomerCustomerNegativeCriterion("[CUSTOMER]", "[CUSTOMER_NEGATIVE_CRITERION]"),
                Id                = -6774108720365892680L,
                Type              = gagve::CriterionTypeEnum.Types.CriterionType.Location,
                ContentLabel      = new gagvc::ContentLabelInfo(),
                MobileApplication = new gagvc::MobileApplicationInfo(),
                MobileAppCategory = new gagvc::MobileAppCategoryInfo(),
                Placement         = new gagvc::PlacementInfo(),
                YoutubeVideo      = new gagvc::YouTubeVideoInfo(),
                YoutubeChannel    = new gagvc::YouTubeChannelInfo(),
            };

            mockGrpcClient.Setup(x => x.GetCustomerNegativeCriterion(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomerNegativeCriterionServiceClient client   = new CustomerNegativeCriterionServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::CustomerNegativeCriterion       response = client.GetCustomerNegativeCriterion(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GetCustomerNegativeCriterion2()
        {
            Mock <CustomerNegativeCriterionService.CustomerNegativeCriterionServiceClient> mockGrpcClient = new Mock <CustomerNegativeCriterionService.CustomerNegativeCriterionServiceClient>(MockBehavior.Strict);
            GetCustomerNegativeCriterionRequest request = new GetCustomerNegativeCriterionRequest
            {
                ResourceName = new CustomerNegativeCriteriaName("[CUSTOMER]", "[CUSTOMER_NEGATIVE_CRITERIA]").ToString(),
            };
            CustomerNegativeCriterion expectedResponse = new CustomerNegativeCriterion
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCustomerNegativeCriterion(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomerNegativeCriterionServiceClient client = new CustomerNegativeCriterionServiceClientImpl(mockGrpcClient.Object, null);
            CustomerNegativeCriterion response            = client.GetCustomerNegativeCriterion(request);

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