public void CompleteTest() { string compResult = "SELECT "; compResult += "NON EMPTY { CrossJoin ([COUNTRY].Members, [CITY].Members) } ON ROWS, "; compResult += "NON EMPTY { { [Measures].[ventas], [Measures].[stock] } } ON COLUMNS "; compResult += "FROM Ventas"; //builder MDXBuilder Builder = new MDXBuilder(); Builder.CubeName = "Ventas"; //ROW Axis MDXAxis RowAxis = new MDXAxis(MDXAxis.ROW_AXIS); CrossJoin CrossJoin = new CrossJoin(new MemberAxisItem("[COUNTRY].Members")); CrossJoin.AddCrossJointTo(new MemberAxisItem("[CITY].Members")); RowAxis.AxisItem = new NonEmpty(CrossJoin); //Column Axis MDXAxis ColumnAxis = new MDXAxis(MDXAxis.COLUMN_AXIS); SetAxisItem setList = new SetAxisItem(new MemberAxisItem("[Measures].[ventas]")); setList.AddAxisItem(new MemberAxisItem("[Measures].[stock]")); ColumnAxis.AxisItem = new NonEmpty(setList); //Add Axis to Builder Builder.AddAxis(RowAxis); Builder.AddAxis(ColumnAxis); Assert.AreEqual(compResult, Builder.Build()); }
public void InitializationWhitSliceAxisByProperty() { MDXAxis axis = new MDXAxis(); axis.AxisType = MDXAxis.SLICE_AXIS; Assert.AreEqual(axis.AxisType, MDXAxis.SLICE_AXIS); }
public void InitializationWhitColumnAxisByProperty() { MDXAxis axis = new MDXAxis(); axis.AxisType = MDXAxis.COLUMN_AXIS; Assert.AreEqual(axis.AxisType, MDXAxis.COLUMN_AXIS); }
public void AxisWithOneAxisItemAndRowType() { MDXAxis axis = new MDXAxis(MDXAxis.ROW_AXIS); var mock = new Mock <IMDXAxisItem>(); mock.Setup(item => item.Build()).Returns("[Country].Members"); axis.AxisItem = mock.Object; Assert.AreEqual(axis.Build(), "[Country].Members ON ROWS"); }
private IMDXAxis ToAxis(CriteriaPropertyAttribute attr, dynamic val) { AbstractWhereItem result = ToWhereItem(attr, val); var axis = new MDXAxis { AxisType = MDXAxis.COLUMN_AXIS }; if (attr.Opration == CriteriaOprations.Eq) { axis.AxisItem = new StringAxisItem($"({{{result.Build()}}})"); } else { axis.AxisItem = new StringAxisItem($"({result.Build()})"); } return(axis); }
public void CompleteTest() { string compResult = "SELECT "; compResult += "NON EMPTY { CrossJoin ([COUNTRY].Members, [CITY].Members) } ON ROWS, "; compResult += "NON EMPTY { { [Measures].[ventas], [Measures].[stock] } } ON COLUMNS "; compResult += "FROM Ventas "; compResult += "SAP VARIABLES "; compResult += "Country INCLUDE = AR "; compResult += "Country INCLUDE = CR"; //builder SAPMDXBuilder Builder = new SAPMDXBuilder(); Builder.CubeName = "Ventas"; //ROW Axis MDXAxis RowAxis = new MDXAxis(MDXAxis.ROW_AXIS); CrossJoin CrossJoin = new CrossJoin(new MemberAxisItem("[COUNTRY].Members")); CrossJoin.AddCrossJointTo(new MemberAxisItem("[CITY].Members")); RowAxis.AxisItem = new NonEmpty(CrossJoin); //Column Axis MDXAxis ColumnAxis = new MDXAxis(MDXAxis.COLUMN_AXIS); SetAxisItem setList = new SetAxisItem(new MemberAxisItem("[Measures].[ventas]")); setList.AddAxisItem(new MemberAxisItem("[Measures].[stock]")); ColumnAxis.AxisItem = new NonEmpty(setList); //Add Axis to Builder Builder.AddAxis(RowAxis); Builder.AddAxis(ColumnAxis); //Add SAP Variables Builder.AddVariable(new MDXSAPVariable("Country", true, MDXSAPVariable.COMP_EQ, "AR")); Builder.AddVariable(new MDXSAPVariable("Country", true, MDXSAPVariable.COMP_EQ, "CR")); Assert.AreEqual(Builder.Build(), compResult); }
public void InitializationWhitSliceAxisByConstructParam() { MDXAxis axis = new MDXAxis(MDXAxis.SLICE_AXIS); Assert.AreEqual(axis.AxisType, MDXAxis.SLICE_AXIS); }
public void InitializationWhitColumnAxisByConstructParam() { MDXAxis axis = new MDXAxis(MDXAxis.COLUMN_AXIS); Assert.AreEqual(axis.AxisType, MDXAxis.COLUMN_AXIS); }
public void InitalizationEmpty() { MDXAxis axis = new MDXAxis(); Assert.AreEqual(axis.Build(), ""); }