public void QueryBuilder_Create_Test() { var query = cube.BuildQuery() .OnRows("sex.male") .OnColumns("category.shoes") .AddMeasuresOrMetrics("quantity"); var result = query.Create(); Assert.IsNotNull(result); }
public void Simple_Query_Month_Year_On_Measure_Quantity() { var queryBuilder = cube.BuildQuery() .OnRows("Month.All") .OnColumns("Year.All") .AddMeasuresOrMetrics("quantity"); var query = queryBuilder.Create(); var result = query.StreamRows().ToList(); Assert.IsTrue(result[0].Length == 2); Assert.IsTrue(result.Count == 13); // output for checking, temporary result.RenderInConsole(); }
public void QueryCube(QuerySettings querySettings) { var queryBuilder = _cube.BuildQuery(); if (querySettings.RowTupples.Count > 0) { queryBuilder.OnRows(querySettings.RowTupples.ToArray()); } if (querySettings.ColumnTupples.Count > 0) { queryBuilder.OnColumns(querySettings.ColumnTupples.ToArray()); } if (querySettings.Measures.Count > 0) { queryBuilder.AddMeasuresOrMetrics(querySettings.Measures.ToArray()); } var query = queryBuilder.Create(); var result = query.StreamRows().ToList(); result.RenderInConsole(); }
public void Query_StreamCells_With_Single_Cell_Test() { var queryBuilder = cube.BuildQuery() .OnRows("sex.female") .OnColumns("category.shoes") .AddMeasuresOrMetrics("quantity"); var query = queryBuilder.Create(); var result = query.StreamCells().ToList(); Assert.IsTrue(result.Count == 1); }