public void GetMetadataResourceNames() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); GetMetadataRequest request = new GetMetadataRequest { MetadataName = MetadataName.FromProperty("[PROPERTY]"), }; Metadata expectedResponse = new Metadata { Dimensions = { new DimensionMetadata(), }, Metrics = { new MetricMetadata(), }, MetadataName = MetadataName.FromProperty("[PROPERTY]"), }; mockGrpcClient.Setup(x => x.GetMetadata(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); Metadata response = client.GetMetadata(request.MetadataName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task GetMetadataResourceNamesAsync() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); GetMetadataRequest request = new GetMetadataRequest { MetadataName = MetadataName.FromProperty("[PROPERTY]"), }; Metadata expectedResponse = new Metadata { Dimensions = { new DimensionMetadata(), }, Metrics = { new MetricMetadata(), }, MetadataName = MetadataName.FromProperty("[PROPERTY]"), }; mockGrpcClient.Setup(x => x.GetMetadataAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Metadata>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); Metadata responseCallSettings = await client.GetMetadataAsync(request.MetadataName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Metadata responseCancellationToken = await client.GetMetadataAsync(request.MetadataName, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void BatchRunPivotReportsRequestObject() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest { Entity = new Entity(), Requests = { new RunPivotReportRequest(), }, }; BatchRunPivotReportsResponse expectedResponse = new BatchRunPivotReportsResponse { PivotReports = { new RunPivotReportResponse(), }, }; mockGrpcClient.Setup(x => x.BatchRunPivotReports(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); BatchRunPivotReportsResponse response = client.BatchRunPivotReports(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task BatchRunPivotReportsRequestObjectAsync() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest { Entity = new Entity(), Requests = { new RunPivotReportRequest(), }, }; BatchRunPivotReportsResponse expectedResponse = new BatchRunPivotReportsResponse { PivotReports = { new RunPivotReportResponse(), }, }; mockGrpcClient.Setup(x => x.BatchRunPivotReportsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <BatchRunPivotReportsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); BatchRunPivotReportsResponse responseCallSettings = await client.BatchRunPivotReportsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); BatchRunPivotReportsResponse responseCancellationToken = await client.BatchRunPivotReportsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
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 async Task RunPivotReportAsync() { Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(MockBehavior.Strict); RunPivotReportRequest request = new RunPivotReportRequest(); RunPivotReportResponse expectedResponse = new RunPivotReportResponse(); mockGrpcClient.Setup(x => x.RunPivotReportAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <RunPivotReportResponse>(Task.FromResult(expectedResponse), null, null, null, null)); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); RunPivotReportResponse response = await client.RunPivotReportAsync(request); 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(); }
public async stt::Task RunReportRequestObjectAsync() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); RunReportRequest request = new RunReportRequest { Entity = new Entity(), Dimensions = { new Dimension(), }, Metrics = { new Metric(), }, DateRanges = { new DateRange(), }, Offset = -4389998161825790342L, Limit = 7494001492025909162L, MetricAggregations = { MetricAggregation.Minimum, }, DimensionFilter = new FilterExpression(), MetricFilter = new FilterExpression(), OrderBys = { new OrderBy(), }, CurrencyCode = "currency_code7f81e352", CohortSpec = new CohortSpec(), KeepEmptyRows = true, ReturnPropertyQuota = true, }; RunReportResponse expectedResponse = new RunReportResponse { MetricHeaders = { new MetricHeader(), }, Rows = { new Row(), }, Metadata = new ResponseMetaData(), PropertyQuota = new PropertyQuota(), Totals = { new Row(), }, Maximums = { new Row(), }, Minimums = { new Row(), }, DimensionHeaders = { new DimensionHeader(), }, RowCount = 743251772, }; mockGrpcClient.Setup(x => x.RunReportAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <RunReportResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); RunReportResponse responseCallSettings = await client.RunReportAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); RunReportResponse responseCancellationToken = await client.RunReportAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void RunReportRequestObject() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); RunReportRequest request = new RunReportRequest { Entity = new Entity(), Dimensions = { new Dimension(), }, Metrics = { new Metric(), }, DateRanges = { new DateRange(), }, Offset = -4389998161825790342L, Limit = 7494001492025909162L, MetricAggregations = { MetricAggregation.Minimum, }, DimensionFilter = new FilterExpression(), MetricFilter = new FilterExpression(), OrderBys = { new OrderBy(), }, CurrencyCode = "currency_code7f81e352", CohortSpec = new CohortSpec(), KeepEmptyRows = true, ReturnPropertyQuota = true, }; RunReportResponse expectedResponse = new RunReportResponse { MetricHeaders = { new MetricHeader(), }, Rows = { new Row(), }, Metadata = new ResponseMetaData(), PropertyQuota = new PropertyQuota(), Totals = { new Row(), }, Maximums = { new Row(), }, Minimums = { new Row(), }, DimensionHeaders = { new DimensionHeader(), }, }; mockGrpcClient.Setup(x => x.RunReport(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); RunReportResponse response = client.RunReport(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task RunRealtimeReportRequestObjectAsync() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); RunRealtimeReportRequest request = new RunRealtimeReportRequest { Property = "propertyc9b48d1a", Dimensions = { new Dimension(), }, Metrics = { new Metric(), }, Limit = 7494001492025909162L, DimensionFilter = new FilterExpression(), MetricFilter = new FilterExpression(), MetricAggregations = { MetricAggregation.Minimum, }, OrderBys = { new OrderBy(), }, ReturnPropertyQuota = true, }; RunRealtimeReportResponse expectedResponse = new RunRealtimeReportResponse { DimensionHeaders = { new DimensionHeader(), }, MetricHeaders = { new MetricHeader(), }, Rows = { new Row(), }, Totals = { new Row(), }, Maximums = { new Row(), }, Minimums = { new Row(), }, RowCount = 743251772, PropertyQuota = new PropertyQuota(), }; mockGrpcClient.Setup(x => x.RunRealtimeReportAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <RunRealtimeReportResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); RunRealtimeReportResponse responseCallSettings = await client.RunRealtimeReportAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); RunRealtimeReportResponse responseCancellationToken = await client.RunRealtimeReportAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void RunRealtimeReportRequestObject() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); RunRealtimeReportRequest request = new RunRealtimeReportRequest { Property = "propertyc9b48d1a", Dimensions = { new Dimension(), }, Metrics = { new Metric(), }, Limit = 7494001492025909162L, DimensionFilter = new FilterExpression(), MetricFilter = new FilterExpression(), MetricAggregations = { MetricAggregation.Minimum, }, OrderBys = { new OrderBy(), }, ReturnPropertyQuota = true, }; RunRealtimeReportResponse expectedResponse = new RunRealtimeReportResponse { DimensionHeaders = { new DimensionHeader(), }, MetricHeaders = { new MetricHeader(), }, Rows = { new Row(), }, Totals = { new Row(), }, Maximums = { new Row(), }, Minimums = { new Row(), }, RowCount = 743251772, PropertyQuota = new PropertyQuota(), }; mockGrpcClient.Setup(x => x.RunRealtimeReport(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); RunRealtimeReportResponse response = client.RunRealtimeReport(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetUniversalMetadataRequestObject() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); GetUniversalMetadataRequest request = new GetUniversalMetadataRequest { }; UniversalMetadata expectedResponse = new UniversalMetadata { Dimensions = { new DimensionMetadata(), }, Metrics = { new MetricMetadata(), }, }; mockGrpcClient.Setup(x => x.GetUniversalMetadata(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); UniversalMetadata response = client.GetUniversalMetadata(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }