public void TestADOTabularCSDLVisitor() { ADOTabularConnection c = new ADOTabularConnection("Data Source=localhost", AdomdType.AnalysisServices); MetaDataVisitorCSDL v = new MetaDataVisitorCSDL(c); ADOTabularModel m = new ADOTabularModel(c, "Test","Test", "Test Description", ""); System.Xml.XmlReader xr = new System.Xml.XmlTextReader(@"..\..\data\csdl.xml"); var tabs = new ADOTabularTableCollection(c,m); v.GenerateTablesFromXmlReader(tabs, xr); Assert.AreEqual(4, tabs.Count); Assert.AreEqual(8, tabs["Sales"].Columns.Count()); }
public void TestADOTabularCSDLVisitorHierarchies() { ADOTabularConnection c = new ADOTabularConnection("Data Source=localhost", AdomdType.AnalysisServices); MetaDataVisitorCSDL v = new MetaDataVisitorCSDL(c); System.Xml.XmlReader xr = new System.Xml.XmlTextReader(@"..\..\data\AdvWrks.xml"); ADOTabularModel m = new ADOTabularModel(c, "Test","Test", "Test Description", ""); var tabs = new ADOTabularTableCollection(c,m); v.GenerateTablesFromXmlReader(tabs, xr); Assert.AreEqual(15, tabs.Count); Assert.AreEqual(24, tabs["Sales Territory"].Columns.Count()); Assert.AreEqual(1, tabs["Sales Territory"].Columns.Where((t) => t.ColumnType == ADOTabularColumnType.Hierarchy).Count()); var h = (ADOTabularHierarchy) (tabs["Sales Territory"].Columns.Where((t) => t.ColumnType == ADOTabularColumnType.Hierarchy).First()); Assert.AreEqual(3, h.Levels.Count); Assert.AreEqual("Group", h.Levels[0].LevelName); Assert.AreEqual("Country", h.Levels[1].LevelName); Assert.AreEqual("Region", h.Levels[2].LevelName); }
public void TestCSDLTablesWithSpaces() { ADOTabularConnection c = new ADOTabularConnection("Data Source=localhost", AdomdType.AnalysisServices); MetaDataVisitorCSDL v = new MetaDataVisitorCSDL(c); ADOTabularModel m = new ADOTabularModel(c, "Test","Test Caption", "Test Description", ""); System.Xml.XmlReader xr = new System.Xml.XmlTextReader(@"..\..\data\advwrkscsdl.xml"); var tabs = new ADOTabularTableCollection(c, m); v.GenerateTablesFromXmlReader(tabs, xr); var cmpyTab = tabs["Sales Quota"]; Assert.AreEqual("Sales Quota", cmpyTab.Caption, "Table Name is translated"); }
public void TestADOTabularCSDLVisitorKPI() { ADOTabularConnection c = new ADOTabularConnection("Data Source=localhost", AdomdType.AnalysisServices); MetaDataVisitorCSDL v = new MetaDataVisitorCSDL(c); System.Xml.XmlReader xr = new System.Xml.XmlTextReader(@"..\..\data\AdvWrks.xml"); ADOTabularModel m = new ADOTabularModel(c, "Test", "Test Caption","Test Description", ""); var tabs = new ADOTabularTableCollection(c, m); v.GenerateTablesFromXmlReader(tabs, xr); Assert.AreEqual(15, tabs.Count); Assert.AreEqual(24, tabs["Sales Territory"].Columns.Count()); Assert.AreEqual(1, tabs["Sales Territory"].Columns.Where((t) => t.ColumnType == ADOTabularColumnType.Hierarchy).Count()); var k = tabs["Sales Territory"].Columns["Total Current Quarter Sales Performance"] as ADOTabularKpi; Assert.AreEqual("Total Current Quarter Sales Performance", k.Caption); Assert.AreEqual("_Total Current Quarter Sales Performance Goal", k.Goal.Caption); Assert.AreEqual("_Total Current Quarter Sales Performance Status", k.Status.Caption); }