Example #1
0
        public void RunPivotReportRequestObject()
        {
            moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict);
            RunPivotReportRequest request = new RunPivotReportRequest
            {
                Entity              = new Entity(),
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                Pivots              = { new Pivot(), },
                DateRanges          = { new DateRange(), },
                CurrencyCode        = "currency_code7f81e352",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = true,
                ReturnPropertyQuota = true,
            };
            RunPivotReportResponse expectedResponse = new RunPivotReportResponse
            {
                PivotHeaders  = { new PivotHeader(), },
                MetricHeaders = { new MetricHeader(), },
                Rows          = { new Row(), },
                Aggregates    = { new Row(), },
                Metadata      = new ResponseMetaData(),
                PropertyQuota = new PropertyQuota(),
            };

            mockGrpcClient.Setup(x => x.RunPivotReport(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlphaAnalyticsDataClient client   = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunPivotReportResponse   response = client.RunPivotReport(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void RunPivotReport()
        {
            Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(MockBehavior.Strict);
            RunPivotReportRequest  request          = new RunPivotReportRequest();
            RunPivotReportResponse expectedResponse = new RunPivotReportResponse();

            mockGrpcClient.Setup(x => x.RunPivotReport(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AlphaAnalyticsDataClient client   = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunPivotReportResponse   response = client.RunPivotReport(request);

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