예제 #1
0
        public void GetPaidOrganicSearchTermView2()
        {
            Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest request = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceName = new PaidOrganicSearchTermViewName("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]").ToString(),
            };
            PaidOrganicSearchTermView expectedResponse = new PaidOrganicSearchTermView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetPaidOrganicSearchTermView(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            PaidOrganicSearchTermViewServiceClient client = new PaidOrganicSearchTermViewServiceClientImpl(mockGrpcClient.Object, null);
            PaidOrganicSearchTermView response            = client.GetPaidOrganicSearchTermView(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #2
0
        public void GetPaidOrganicSearchTermView()
        {
            moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(moq::MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest request = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerPaidOrganicSearchTermView("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]"),
            };
            gagvr::PaidOrganicSearchTermView expectedResponse = new gagvr::PaidOrganicSearchTermView
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerPaidOrganicSearchTermView("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]"),
                SearchTerm = "search_term6c01a1df",
            };

            mockGrpcClient.Setup(x => x.GetPaidOrganicSearchTermView(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PaidOrganicSearchTermViewServiceClient client   = new PaidOrganicSearchTermViewServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::PaidOrganicSearchTermView       response = client.GetPaidOrganicSearchTermView(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GetPaidOrganicSearchTermViewRequestObject()
        {
            moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(moq::MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest request = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerCampaignAdGroupBase64SearchTerm("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[AD_GROUP_ID]", "[BASE64_SEARCH_TERM]"),
            };
            gagvr::PaidOrganicSearchTermView expectedResponse = new gagvr::PaidOrganicSearchTermView
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerCampaignAdGroupBase64SearchTerm("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[AD_GROUP_ID]", "[BASE64_SEARCH_TERM]"),
                SearchTerm = "search_term6c01a1df",
            };

            mockGrpcClient.Setup(x => x.GetPaidOrganicSearchTermView(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PaidOrganicSearchTermViewServiceClient client   = new PaidOrganicSearchTermViewServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::PaidOrganicSearchTermView       response = client.GetPaidOrganicSearchTermView(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #4
0
        public async Task GetPaidOrganicSearchTermViewAsync()
        {
            Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest expectedRequest = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceName = new PaidOrganicSearchTermViewName("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]").ToString(),
            };
            PaidOrganicSearchTermView expectedResponse = new PaidOrganicSearchTermView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetPaidOrganicSearchTermViewAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <PaidOrganicSearchTermView>(Task.FromResult(expectedResponse), null, null, null, null));
            PaidOrganicSearchTermViewServiceClient client = new PaidOrganicSearchTermViewServiceClientImpl(mockGrpcClient.Object, null);
            string formattedResourceName       = new PaidOrganicSearchTermViewName("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]").ToString();
            PaidOrganicSearchTermView response = await client.GetPaidOrganicSearchTermViewAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #5
0
        public async stt::Task GetPaidOrganicSearchTermViewRequestObjectAsync()
        {
            moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(moq::MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest request = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerPaidOrganicSearchTermView("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]"),
            };
            gagvr::PaidOrganicSearchTermView expectedResponse = new gagvr::PaidOrganicSearchTermView
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerPaidOrganicSearchTermView("[CUSTOMER]", "[PAID_ORGANIC_SEARCH_TERM_VIEW]"),
                SearchTerm = "search_term6c01a1df",
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GetPaidOrganicSearchTermViewAsync()
        {
            moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient> mockGrpcClient = new moq::Mock <PaidOrganicSearchTermViewService.PaidOrganicSearchTermViewServiceClient>(moq::MockBehavior.Strict);
            GetPaidOrganicSearchTermViewRequest request = new GetPaidOrganicSearchTermViewRequest
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerCampaignAdGroupBase64SearchTerm("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[AD_GROUP_ID]", "[BASE64_SEARCH_TERM]"),
            };
            gagvr::PaidOrganicSearchTermView expectedResponse = new gagvr::PaidOrganicSearchTermView
            {
                ResourceNameAsPaidOrganicSearchTermViewName = gagvr::PaidOrganicSearchTermViewName.FromCustomerCampaignAdGroupBase64SearchTerm("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[AD_GROUP_ID]", "[BASE64_SEARCH_TERM]"),
                SearchTerm = "search_term6c01a1df",
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            gagvr::PaidOrganicSearchTermView responseCancellationToken = await client.GetPaidOrganicSearchTermViewAsync(request.ResourceName, st::CancellationToken.None);

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