public void List_LevelsWithMemberChildrenAndExclusion_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var member = "January 2005"; var excludedPatterns = new List <PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "3" } }; var cmd = new MembersCommand(connStr, "Children", member, null, excludedPatterns); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies), new CaptionFilter("Month", DiscoveryTarget.Levels) }; var result = cmd.List(filters); //Returns the 31 days of the month minus 3, 13, 23, 30, 31 Assert.That(result.Count, Is.EqualTo(31 - 5)); }
public void List_HierarchyWithMemberChildrenAndExclusion_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var member = "Q3 CY 2006"; var excludedMembers = new List <string>() { "All" }; var excludedPatterns = new List <PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "em" } }; var cmd = new MembersCommand(connStr, "Children", member, excludedMembers, excludedPatterns); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies), }; var result = cmd.List(filters); //REturns the 3 months of the Q3 and remove SeptEMber Assert.That(result.Count, Is.EqualTo(2)); }
public void List_LevelWithExclusionOfPatternContainEm_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var excludedMembers = new List <string>() { "All" }; var excludedPatterns = new List <PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "em" } }; var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies), new CaptionFilter("Month", DiscoveryTarget.Levels), }; var result = cmd.List(filters); //6years and exlude SeptEMber, NovEMber, DecEMber (+All) Assert.That(result.Count, Is.EqualTo(6 * 9)); }
public void List_HierarchyWithExclusionOfPatternStartingByJu_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var excludedMembers = new List <string>() { "All" }; var excludedPatterns = new List <PatternValue>() { new PatternValue() { Pattern = Pattern.StartWith, Text = "Ju" } }; var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies), }; var result = cmd.List(filters); Assert.That(result.Count, Is.EqualTo(10)); }
public void List_Set_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var cmd = new MembersCommand(connStr, string.Empty, string.Empty, null, null); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Top 50 Customers", DiscoveryTarget.Sets) }; var result = cmd.List(filters); Assert.That(result.Count, Is.EqualTo(50)); }
public void List_Hierarchy_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var cmd = new MembersCommand(connStr, "Members", null); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies), }; var result = cmd.List(filters); Assert.That(result.Count, Is.EqualTo(13)); }
public void List_HierarchyWithMemberChildren_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var member = "Q3 CY 2006"; var cmd = new MembersCommand(connStr, "Children", member, null, null); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies), }; var result = cmd.List(filters); //REturns the 3 months of the Q3 Assert.That(result.Count, Is.EqualTo(3)); }
public void List_LevelWithExclusionOfJanuary2005AndNonExistingMember_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var excludedMembers = new List <string>() { "January 2005", "Non existing month 2005" }; var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, null); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Date", DiscoveryTarget.Dimensions), new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies), new CaptionFilter("Month", DiscoveryTarget.Levels) }; var result = cmd.List(filters); Assert.That(result.Count, Is.EqualTo(71)); }
public void List_SetWithExclusion_ListOfMembers() { var connStr = ConnectionStringReader.GetAdomd(); var excludedPatterns = new List <PatternValue>() { new PatternValue() { Pattern = Pattern.StartWith, Text = "A" } }; var cmd = new MembersCommand(connStr, string.Empty, string.Empty, null, excludedPatterns); var filters = new List <CaptionFilter>() { new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives), new CaptionFilter("Top 50 Customers", DiscoveryTarget.Sets) }; var result = cmd.List(filters); Assert.That(result.Count, Is.EqualTo(50)); }