public async stt::Task GetAdGroupSimulationRequestObjectAsync()
        {
            moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient> mockGrpcClient = new moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient>(moq::MockBehavior.Strict);
            GetAdGroupSimulationRequest request = new GetAdGroupSimulationRequest
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupTypeModificationMethodStartDateEndDate("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[TYPE]", "[MODIFICATION_METHOD]", "[START_DATE]", "[END_DATE]"),
            };
            gagvr::AdGroupSimulation expectedResponse = new gagvr::AdGroupSimulation
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupTypeModificationMethodStartDateEndDate("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[TYPE]", "[MODIFICATION_METHOD]", "[START_DATE]", "[END_DATE]"),
                Type = gagve::SimulationTypeEnum.Types.SimulationType.BidModifier,
                ModificationMethod  = gagve::SimulationModificationMethodEnum.Types.SimulationModificationMethod.Default,
                CpcBidPointList     = new gagvc::CpcBidSimulationPointList(),
                TargetCpaPointList  = new gagvc::TargetCpaSimulationPointList(),
                CpvBidPointList     = new gagvc::CpvBidSimulationPointList(),
                TargetRoasPointList = new gagvc::TargetRoasSimulationPointList(),
                AdGroupId           = -2072405675042603230L,
                StartDate           = "start_date11b9dbea",
                EndDate             = "end_date89dae890",
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public void GetAdGroupSimulation()
        {
            moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient> mockGrpcClient = new moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient>(moq::MockBehavior.Strict);
            GetAdGroupSimulationRequest request = new GetAdGroupSimulationRequest
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupSimulation("[CUSTOMER]", "[AD_GROUP_SIMULATION]"),
            };
            gagvr::AdGroupSimulation expectedResponse = new gagvr::AdGroupSimulation
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupSimulation("[CUSTOMER]", "[AD_GROUP_SIMULATION]"),
                AdGroupId          = -2072405675042603230L,
                Type               = gagve::SimulationTypeEnum.Types.SimulationType.CpvBid,
                ModificationMethod = gagve::SimulationModificationMethodEnum.Types.SimulationModificationMethod.Unknown,
                StartDate          = "start_date11b9dbea",
                EndDate            = "end_date89dae890",
                CpcBidPointList    = new gagvc::CpcBidSimulationPointList(),
                TargetCpaPointList = new gagvc::TargetCpaSimulationPointList(),
                CpvBidPointList    = new gagvc::CpvBidSimulationPointList(),
            };

            mockGrpcClient.Setup(x => x.GetAdGroupSimulation(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AdGroupSimulationServiceClient client   = new AdGroupSimulationServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AdGroupSimulation       response = client.GetAdGroupSimulation(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GetAdGroupSimulation()
        {
            moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient> mockGrpcClient = new moq::Mock <AdGroupSimulationService.AdGroupSimulationServiceClient>(moq::MockBehavior.Strict);
            GetAdGroupSimulationRequest request = new GetAdGroupSimulationRequest
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupTypeModificationMethodStartDateEndDate("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[TYPE]", "[MODIFICATION_METHOD]", "[START_DATE]", "[END_DATE]"),
            };
            gagvr::AdGroupSimulation expectedResponse = new gagvr::AdGroupSimulation
            {
                ResourceNameAsAdGroupSimulationName = gagvr::AdGroupSimulationName.FromCustomerAdGroupTypeModificationMethodStartDateEndDate("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[TYPE]", "[MODIFICATION_METHOD]", "[START_DATE]", "[END_DATE]"),
                Type = gagve::SimulationTypeEnum.Types.SimulationType.BidModifier,
                ModificationMethod  = gagve::SimulationModificationMethodEnum.Types.SimulationModificationMethod.Default,
                CpcBidPointList     = new gagvc::CpcBidSimulationPointList(),
                TargetCpaPointList  = new gagvc::TargetCpaSimulationPointList(),
                CpvBidPointList     = new gagvc::CpvBidSimulationPointList(),
                TargetRoasPointList = new gagvc::TargetRoasSimulationPointList(),
                AdGroupId           = -2072405675042603230L,
                StartDate           = "start_date11b9dbea",
                EndDate             = "end_date89dae890",
            };

            mockGrpcClient.Setup(x => x.GetAdGroupSimulation(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AdGroupSimulationServiceClient client   = new AdGroupSimulationServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AdGroupSimulation       response = client.GetAdGroupSimulation(request.ResourceName);

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