public void GetCampaignSharedSet2()
        {
            Mock <CampaignSharedSetService.CampaignSharedSetServiceClient> mockGrpcClient = new Mock <CampaignSharedSetService.CampaignSharedSetServiceClient>(MockBehavior.Strict);
            GetCampaignSharedSetRequest request = new GetCampaignSharedSetRequest
            {
                ResourceName = new CampaignSharedSetName("[CUSTOMER]", "[CAMPAIGN_SHARED_SET]").ToString(),
            };
            CampaignSharedSet expectedResponse = new CampaignSharedSet
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCampaignSharedSet(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CampaignSharedSetServiceClient client = new CampaignSharedSetServiceClientImpl(mockGrpcClient.Object, null);
            CampaignSharedSet response            = client.GetCampaignSharedSet(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #2
0
        public void GetCampaignSharedSet()
        {
            moq::Mock <CampaignSharedSetService.CampaignSharedSetServiceClient> mockGrpcClient = new moq::Mock <CampaignSharedSetService.CampaignSharedSetServiceClient>(moq::MockBehavior.Strict);
            GetCampaignSharedSetRequest request = new GetCampaignSharedSetRequest
            {
                ResourceNameAsCampaignSharedSetName = gagvr::CampaignSharedSetName.FromCustomerCampaignSharedSet("[CUSTOMER]", "[CAMPAIGN_SHARED_SET]"),
            };
            gagvr::CampaignSharedSet expectedResponse = new gagvr::CampaignSharedSet
            {
                ResourceNameAsCampaignSharedSetName = gagvr::CampaignSharedSetName.FromCustomerCampaignSharedSet("[CUSTOMER]", "[CAMPAIGN_SHARED_SET]"),
                Status = gagve::CampaignSharedSetStatusEnum.Types.CampaignSharedSetStatus.Enabled,
                CampaignAsCampaignName   = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER]", "[CAMPAIGN]"),
                SharedSetAsSharedSetName = gagvr::SharedSetName.FromCustomerSharedSet("[CUSTOMER]", "[SHARED_SET]"),
            };

            mockGrpcClient.Setup(x => x.GetCampaignSharedSet(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CampaignSharedSetServiceClient client   = new CampaignSharedSetServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::CampaignSharedSet       response = client.GetCampaignSharedSet(request.ResourceName);

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