Beispiel #1
0
        public async stt::Task CheckCompatibilityRequestObjectAsync()
        {
            moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient> mockGrpcClient = new moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient>(moq::MockBehavior.Strict);
            CheckCompatibilityRequest request = new CheckCompatibilityRequest
            {
                Property            = "propertyc9b48d1a",
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                CompatibilityFilter = Compatibility.Incompatible,
            };
            CheckCompatibilityResponse expectedResponse = new CheckCompatibilityResponse
            {
                DimensionCompatibilities =
                {
                    new DimensionCompatibility(),
                },
                MetricCompatibilities =
                {
                    new MetricCompatibility(),
                },
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            CheckCompatibilityResponse responseCancellationToken = await client.CheckCompatibilityAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public void CheckCompatibilityRequestObject()
        {
            moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient> mockGrpcClient = new moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient>(moq::MockBehavior.Strict);
            CheckCompatibilityRequest request = new CheckCompatibilityRequest
            {
                Property            = "propertyc9b48d1a",
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                CompatibilityFilter = Compatibility.Incompatible,
            };
            CheckCompatibilityResponse expectedResponse = new CheckCompatibilityResponse
            {
                DimensionCompatibilities =
                {
                    new DimensionCompatibility(),
                },
                MetricCompatibilities =
                {
                    new MetricCompatibility(),
                },
            };

            mockGrpcClient.Setup(x => x.CheckCompatibility(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            BetaAnalyticsDataClient    client   = new BetaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            CheckCompatibilityResponse response = client.CheckCompatibility(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #3
0
 /// <summary>Snippet for CheckCompatibility</summary>
 public void CheckCompatibilityRequestObject()
 {
     // Snippet: CheckCompatibility(CheckCompatibilityRequest, CallSettings)
     // Create client
     BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
     // Initialize request argument(s)
     CheckCompatibilityRequest request = new CheckCompatibilityRequest
     {
         Property            = "",
         Dimensions          = { new Dimension(), },
         Metrics             = { new Metric(), },
         DimensionFilter     = new FilterExpression(),
         MetricFilter        = new FilterExpression(),
         CompatibilityFilter = Compatibility.Unspecified,
     };
     // Make the request
     CheckCompatibilityResponse response = betaAnalyticsDataClient.CheckCompatibility(request);
     // End snippet
 }
Beispiel #4
0
        /// <summary>Snippet for CheckCompatibilityAsync</summary>
        public async Task CheckCompatibilityRequestObjectAsync()
        {
            // Snippet: CheckCompatibilityAsync(CheckCompatibilityRequest, CallSettings)
            // Additional: CheckCompatibilityAsync(CheckCompatibilityRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            CheckCompatibilityRequest request = new CheckCompatibilityRequest
            {
                Property            = "",
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                CompatibilityFilter = Compatibility.Unspecified,
            };
            // Make the request
            CheckCompatibilityResponse response = await betaAnalyticsDataClient.CheckCompatibilityAsync(request);

            // End snippet
        }