Exemple #1
0
        public async stt::Task GetConversionCustomVariableRequestObjectAsync()
        {
            moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient> mockGrpcClient = new moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient>(moq::MockBehavior.Strict);
            GetConversionCustomVariableRequest request = new GetConversionCustomVariableRequest
            {
                ResourceNameAsConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
            };
            gagvr::ConversionCustomVariable expectedResponse = new gagvr::ConversionCustomVariable
            {
                ResourceNameAsConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
                Id = -6774108720365892680L,
                ConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
                Tag    = "tag843ed2e4",
                Status = gagve::ConversionCustomVariableStatusEnum.Types.ConversionCustomVariableStatus.Paused,
                OwnerCustomerAsCustomerName = gagvr::CustomerName.FromCustomer("[CUSTOMER_ID]"),
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for GetConversionCustomVariable</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetConversionCustomVariableRequestObject()
 {
     // Create client
     ConversionCustomVariableServiceClient conversionCustomVariableServiceClient = ConversionCustomVariableServiceClient.Create();
     // Initialize request argument(s)
     GetConversionCustomVariableRequest request = new GetConversionCustomVariableRequest
     {
         ResourceNameAsConversionCustomVariableName = ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
     };
     // Make the request
     ConversionCustomVariable response = conversionCustomVariableServiceClient.GetConversionCustomVariable(request);
 }
        /// <summary>Snippet for GetConversionCustomVariableAsync</summary>
        public async Task GetConversionCustomVariableRequestObjectAsync()
        {
            // Snippet: GetConversionCustomVariableAsync(GetConversionCustomVariableRequest, CallSettings)
            // Additional: GetConversionCustomVariableAsync(GetConversionCustomVariableRequest, CancellationToken)
            // Create client
            ConversionCustomVariableServiceClient conversionCustomVariableServiceClient = await ConversionCustomVariableServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetConversionCustomVariableRequest request = new GetConversionCustomVariableRequest
            {
                ResourceNameAsConversionCustomVariableName = ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
            };
            // Make the request
            ConversionCustomVariable response = await conversionCustomVariableServiceClient.GetConversionCustomVariableAsync(request);

            // End snippet
        }
Exemple #4
0
        public void GetConversionCustomVariable()
        {
            moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient> mockGrpcClient = new moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient>(moq::MockBehavior.Strict);
            GetConversionCustomVariableRequest request = new GetConversionCustomVariableRequest
            {
                ResourceNameAsConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
            };
            gagvr::ConversionCustomVariable expectedResponse = new gagvr::ConversionCustomVariable
            {
                ResourceNameAsConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
                Id = -6774108720365892680L,
                ConversionCustomVariableName = gagvr::ConversionCustomVariableName.FromCustomerConversionCustomVariable("[CUSTOMER_ID]", "[CONVERSION_CUSTOM_VARIABLE_ID]"),
                Tag    = "tag843ed2e4",
                Status = gagve::ConversionCustomVariableStatusEnum.Types.ConversionCustomVariableStatus.Paused,
                OwnerCustomerAsCustomerName = gagvr::CustomerName.FromCustomer("[CUSTOMER_ID]"),
            };

            mockGrpcClient.Setup(x => x.GetConversionCustomVariable(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ConversionCustomVariableServiceClient client   = new ConversionCustomVariableServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::ConversionCustomVariable       response = client.GetConversionCustomVariable(request.ResourceName);

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