How to use GetMembers method of NBi.Core.Analysis.Member.MembersAdomdEngine class

Best NBi code snippet using NBi.Core.Analysis.Member.MembersAdomdEngine.GetMembers

ContainsConstraintTest.cs

Source:ContainsConstraintTest.cs Github

copy

Full Screen

...29 members.Add(member1);30 members.Add(member2);3132 var meMock = new Mock<MembersAdomdEngine>();33 meMock.Setup(engine => engine.GetMembers(cmd))34 .Returns(members);35 var me = meMock.Object;3637 var containsConstraint = new ContainConstraint(exp) { MembersEngine = me };3839 //Method under test40 containsConstraint.Matches(cmd);4142 //Test conclusion 43 meMock.Verify(engine => engine.GetMembers(cmd), Times.Once());44 }4546 [Test]47 public void WriteTo_FailingAssertionForChild_TextContainsFewKeyInfo()48 {49 var exp = "Expected member";50 var cmd = new DiscoveryRequestFactory().Build(51 "connectionString",52 "member-caption",53 "perspective-name",54 "dimension-caption",55 "hierarchy-caption",56 null);5758 var memberStub = new Mock<NBi.Core.Analysis.Member.Member>();59 var member1 = memberStub.Object;60 var member2 = memberStub.Object;61 var members = new MemberResult();62 members.Add(member1);63 members.Add(member2);6465 var meStub = new Mock<MembersAdomdEngine>();66 meStub.Setup(engine => engine.GetMembers(cmd))67 .Returns(members);68 var me = meStub.Object;6970 var containsConstraint = new ContainConstraint(exp) { MembersEngine = me };7172 //Method under test73 string assertionText = null;74 try75 {76 Assert.That(cmd, containsConstraint);77 }78 catch (AssertionException ex)79 {80 assertionText = ex.Message;81 }8283 //Test conclusion 84 Assert.That(assertionText, Is.StringContaining("perspective-name").And85 .StringContaining("dimension-caption").And86 .StringContaining("hierarchy-caption").And87 .StringContaining("child").And88 .StringContaining("Expected member"));8990 }9192 [Test]93 public void WriteTo_FailingAssertionForMember_TextContainsFewKeyInfo()94 {95 var exp = "Expected member";96 var cmd = new DiscoveryRequestFactory().Build(97 "connectionString",98 string.Empty,99 "perspective-name",100 "dimension-caption",101 "hierarchy-caption",102 "level-caption");103104 var memberStub = new Mock<NBi.Core.Analysis.Member.Member>();105 var member1 = memberStub.Object;106 var member2 = memberStub.Object;107 var members = new MemberResult();108 members.Add(member1);109 members.Add(member2);110111 var meStub = new Mock<MembersAdomdEngine>();112 meStub.Setup(engine => engine.GetMembers(cmd))113 .Returns(members);114 var me = meStub.Object;115116 var containsConstraint = new ContainConstraint(exp) { MembersEngine = me };117118 //Method under test119 string assertionText = null;120 try121 {122 Assert.That(cmd, containsConstraint);123 }124 catch (AssertionException ex)125 {126 assertionText = ex.Message; ...

Full Screen

Full Screen

MembersAdomdEngineTest.cs

Source:MembersAdomdEngineTest.cs Github

copy

Full Screen

...40 #endregion4142 [Test]43 [Category("Olap")]44 public void GetMembers_ByLevel_ReturnListMembersWithCorrectCaptions()45 {46 //Buiding object used during test47 var mae = new MembersAdomdEngine();48 var disco = new DiscoveryRequestFactory().Build(49 ConnectionStringReader.GetAdomd(),50 string.Empty,51 "Adventure Works",52 "Geography",53 "Geography",54 "Country"55 );5657 //Call the method to test58 var actual = mae.GetMembers(disco);5960 ////Assertion61 Assert.That(List.Map(actual).Property("Caption"), Has.None.EqualTo("All"));62 Assert.That(List.Map(actual).Property("Caption"), Has.Member("Canada"));63 Assert.That(List.Map(actual).Property("Caption"), Has.Member("France"));64 }6566 [Test]67 public void GetMembers_ByLevel_ReturnListMembersWithCorrectUniqueName()68 {69 //Buiding object used during test70 var mae = new MembersAdomdEngine();71 var disco = new DiscoveryRequestFactory().Build(72 ConnectionStringReader.GetAdomd(),73 string.Empty,74 "Adventure Works",75 "Geography",76 "Geography",77 "Country"78 );7980 //Call the method to test81 var actual = mae.GetMembers(disco);8283 //Assertion84 Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[Country].&[Canada]"));85 Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[Country].&[France]"));86 }8788 [Test]89 public void GetMembers_ByLevel_ReturnListMembersWithCorrectOrdinal()90 {91 var mae = new MembersAdomdEngine();92 var disco = new DiscoveryRequestFactory().Build(93 ConnectionStringReader.GetAdomd(),94 string.Empty,95 "Adventure Works",96 "Geography",97 "Geography",98 "Country"99 );100101 //Call the method to test102 var actual = mae.GetMembers(disco);103104 //Assertion105 Assert.That(List.Map(actual).Property("Ordinal"), Is.Unique);106 Assert.That(List.Map(actual).Property("Ordinal"), Has.All.GreaterThan(0));107 }108109 [Test]110 public void GetMembers_ByLevel_ReturnListMembersWithCorrectLevelNumber()111 {112 var mae = new MembersAdomdEngine();113 var disco = new DiscoveryRequestFactory().Build(114 ConnectionStringReader.GetAdomd(),115 string.Empty,116 "Adventure Works",117 "Geography",118 "Geography",119 "Country"120 );121122 //Call the method to test123 var actual = mae.GetMembers(disco);124125 //Assertion126 Assert.That(List.Map(actual).Property("LevelNumber"), Has.All.EqualTo(1));127 }128129 [Test]130 public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectCaptions()131 {132 //Buiding object used during test133 var mae = new MembersAdomdEngine();134 var disco = new DiscoveryRequestFactory().Build(135 ConnectionStringReader.GetAdomd(),136 string.Empty,137 "Adventure Works",138 "Geography",139 "Geography",140 null141 );142143 //Call the method to test144 var actual = mae.GetMembers(disco);145146 //Assertion147 Assert.That(List.Map(actual).Property("Caption"), Has.Member("All Geographies"));148 Assert.That(List.Map(actual).Property("Caption"), Has.Member("Canada"));149 Assert.That(List.Map(actual).Property("Caption"), Has.Member("France"));150 }151152 [Test]153 public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectUniqueName()154 {155 //Buiding object used during test156 var mae = new MembersAdomdEngine();157 var disco = new DiscoveryRequestFactory().Build(158 ConnectionStringReader.GetAdomd(),159 string.Empty,160 "Adventure Works",161 "Geography",162 "Geography",163 null164 );165166 //Call the method to test167 var actual = mae.GetMembers(disco);168169 ////Assertion170 Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[Country].&[Canada]"));171 Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[City].&[Toronto]&[ON]"));172 }173174 [Test]175 public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectOrdinal()176 {177 //Buiding object used during test178 var mae = new MembersAdomdEngine();179 var disco = new DiscoveryRequestFactory().Build(180 ConnectionStringReader.GetAdomd(),181 string.Empty,182 "Adventure Works",183 "Geography",184 "Geography",185 null186 );187188 //Call the method to test189 var actual = mae.GetMembers(disco);190191 ////Assertion192 Assert.That(actual, Has.Count.GreaterThan(0));193 Assert.That(List.Map(actual).Property("Ordinal"), Is.Unique);194 Assert.That(List.Map(actual).Property("Ordinal"), Has.All.GreaterThanOrEqualTo(0));195 }196197 [Test]198 public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectLevelNumber()199 {200 //Buiding object used during test201 var mae = new MembersAdomdEngine();202 var disco = new DiscoveryRequestFactory().Build(203 ConnectionStringReader.GetAdomd(),204 string.Empty,205 "Adventure Works",206 "Geography",207 "Geography",208 null209 );210211 //Call the method to test212 var actual = mae.GetMembers(disco);213214 ////Assertion215 Assert.That(actual, Has.Count.GreaterThan(0));216 //0 = All217 Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(0));218 //1 = Country219 Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(1));220 //2 = State/Province221 Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(2));222 //3 = Town223 Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(3));224 //4 = Zip code225 Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(4));226 //Nothing else 227 Assert.That(List.Map(actual).Property("LevelNumber"), Has.All.LessThanOrEqualTo(4));228229 }230231 [Test]232 public void GetMembersDax_ByLevel_ReturnListMembersWithCorrectCaptions()233 {234 //Buiding object used during test235 var mae = new MembersAdomdEngine();236 var disco = new DiscoveryRequestFactory().Build(237 ConnectionStringReader.GetAdomdTabular(),238 string.Empty,239 "Internet Operation",240 "Geography",241 "Geography",242 "Country Region"243 );244245 //Call the method to test246 var actual = mae.GetMembers(disco);247248 ////Assertion249 Assert.That(List.Map(actual).Property("Caption"), Has.None.EqualTo("All"));250 Assert.That(List.Map(actual).Property("Caption"), Has.Member("Canada"));251 Assert.That(List.Map(actual).Property("Caption"), Has.Member("France"));252 }253 }254} ...

Full Screen

Full Screen

AbstractMembersConstraint.cs

Source:AbstractMembersConstraint.cs Github

copy

Full Screen

...103 protected bool Process(MembersDiscoveryRequest actual)104 {105 Request = actual;106 var engine = MembersEngine;107 MemberResult result = engine.GetMembers(Request);108 return this.Matches(result);109 }110111 #endregion112113 }114} ...

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Analysis.Member;7{8 {9 static void Main(string[] args)10 {11 string connectionString = "Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW 2008R2;";12 string dimensionName = "Date";13 string hierarchyName = "Date";14 string levelName = "Year";15 string memberName = "2008";16 string memberType = "All";17 MembersAdomdEngine membersAdomdEngine = new MembersAdomdEngine(connectionString);18 var members = membersAdomdEngine.GetMembers(dimensionName, hierarchyName, levelName, memberName, memberType);19 foreach (var member in members)20 {21 Console.WriteLine(member.Caption);22 }23 Console.ReadLine();24 }25 }26}27using System;28using System.Collections.Generic;29using System.Linq;30using System.Text;31using System.Threading.Tasks;32using NBi.Core.Analysis.Member;33{34 {35 static void Main(string[] args)36 {37 string connectionString = "Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW 2008R2;";38 string dimensionName = "Date";39 string hierarchyName = "Date";40 string levelName = "Year";41 string memberName = "2008";42 string memberType = "All";43 MembersAdomdEngine membersAdomdEngine = new MembersAdomdEngine(connectionString);44 var members = membersAdomdEngine.GetMembers(dimensionName, hierarchyName, levelName, memberName, memberType);45 foreach (var member in members)46 {47 Console.WriteLine(member.Caption);48 }49 Console.ReadLine();50 }51 }52}53using System;54using System.Collections.Generic;55using System.Linq;56using System.Text;57using System.Threading.Tasks;58using NBi.Core.Analysis.Member;59{60 {61 static void Main(string[] args)62 {

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Member;2using System;3using System.Collections.Generic;4using System.Linq;5using System.Text;6using System.Threading.Tasks;7{8 {9 static void Main(string[] args)10 {11 var engine = new MembersAdomdEngine(@"Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Adventure Works DW 2008R2;Data Source=.\SQL2012", "Adventure Works DW 2008R2", "[Date]");12 var members = engine.GetMembers();13 Console.WriteLine(members.Count());14 Console.ReadLine();15 }16 }17}

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Analysis.Member;7using NBi.Core.Analysis.Request;8{9 {10 static void Main(string[] args)11 {12 var engine = new MembersAdomdEngine();13 var request = new MemberDiscoveryRequest();14 request.ConnectionString = "Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Adventure Works DW Standard Edition;Data Source=AdventureWorksDW2012";15 request.CubeName = "Adventure Works";16 request.DimensionUniqueName = "[Date]";17 request.HierarchyUniqueName = "[Date].[Fiscal]";18 request.LevelUniqueName = "[Date].[Fiscal].[Fiscal Year]";19 var members = engine.GetMembers(request);20 }21 }22}

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Analysis.Member;7using System.Data.OleDb;8using System.Data;9{10 {11 static void Main(string[] args)12 {13 string connectionString = "Provider=MSOLAP;Data Source=serverName;Initial Catalog=catalogName;User ID=userName;Password=password";14 string dimensionName = "dimensionName";15 string hierarchyName = "hierarchyName";16 string levelName = "levelName";17 string filter = "filter";18 string query = "select " + levelName + " from " + dimensionName + " on 0 where " + levelName + " like '" + filter + "%'";19 OleDbConnection conn = new OleDbConnection(connectionString);20 conn.Open();21 OleDbCommand cmd = new OleDbCommand(query, conn);22 OleDbDataReader reader = cmd.ExecuteReader();23 List<string> members = new List<string>();24 while (reader.Read())25 {26 members.Add(reader.GetString(0));27 }28 reader.Close();29 conn.Close();30 MembersAdomdEngine engine = new MembersAdomdEngine();31 var result = engine.GetMembers(connectionString, dimensionName, hierarchyName, levelName, members);32 }33 }34}35using System;36using System.Collections.Generic;37using System.Linq;38using System.Text;39using System.Threading.Tasks;40using NBi.Core.Analysis.Member;41using System.Data.OleDb;42using System.Data;43{44 {45 static void Main(string[] args)46 {47 string connectionString = "Provider=MSOLAP;Data Source=serverName;Initial Catalog=catalogName;User ID=userName;Password=password";48 string dimensionName = "dimensionName";49 string hierarchyName = "hierarchyName";50 string levelName = "levelName";51 string filter = "filter";52 string query = "select " + levelName + " from " + dimensionName + " on 0 where " + levelName + " like '" + filter + "%'";53 OleDbConnection conn = new OleDbConnection(connectionString);54 conn.Open();55 OleDbCommand cmd = new OleDbCommand(query, conn);

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using NBi.Core.Analysis.Member;6using System.Data;7using System.Data.OleDb;8using System.Data.Common;9using System.Data.Odbc;10using System.Data.SqlClient;11using System.Data.OleDb;12using System.Data.OracleClient;13using System.Data.OracleClient;14using System.Data.SqlClient;15using System.Data.SqlServerCe;16using System.Data.SqlServerCe;17using System.Data.SqlTypes;18using System.Data.SqlTypes;19using System.Data.SqlTypes;20using System.Data.SqlTypes;21{22 {23 static void Main(string[] args)24 {25 MembersAdomdEngine membersAdomdEngine = new MembersAdomdEngine(connectionString);26 DataTable dt = membersAdomdEngine.GetMembers("[Date].[Calendar].[Calendar Year]", true);27 Console.WriteLine(dt.Rows.Count);28 Console.Read();29 }30 }31}32DataTable dt = membersAdomdEngine.GetMembers("[Date].[Calendar].[Calendar Year]", true);33DataTable dt = membersAdomdEngine.GetMembers("[Date].[Calendar]", true);34DataTable dt = membersAdomdEngine.GetMembers("[Date]", true);35DataTable dt = membersAdomdEngine.GetMembers("[Measures]", true);36DataTable dt = membersAdomdEngine.GetMembers("[Measures].[Currency]", true);

Full Screen

Full Screen

GetMembers

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Analysis.Member;7using System.Data.OleDb;8using System.Data;9using System.Data.Common;10using System.Data.Odbc;11using System.Data.SqlClient;12using System.Data.SqlServerCe;13using System.Data.OleDb;14using System.Data.OracleClient;15using System.Data.SqlTypes;16using System.Data.Sql;17using System.Data.SqlServerCe;18using System.Data.Common;19using System.Text.RegularExpressions;20using System.IO;21using System.Data;22using System.Data.Common;23using System.Data.Odbc;24using System.Data.SqlClient;25using System.Data.SqlServerCe;26using System.Data.OleDb;27using System.Data.OracleClient;28using System.Data.SqlTypes;29using System.Data.Sql;30using System.Data.SqlServerCe;31using System.Data.Common;32using System.Text.RegularExpressions;33using System.IO;34{35 {36 static void Main(string[] args)37 {38 var catalog = new NBi.Core.Analysis.Metadata.Adomd.AdomdMetadataDiscoveryCommand(connectionString);39 var engine = new NBi.Core.Analysis.Member.MembersAdomdEngine(catalog.Execute());40 var members = engine.GetMembers("[Customer].[Customer Geography].[Country]");41 foreach (var member in members)42 {43 Console.WriteLine(member);44 }45 Console.ReadLine();46 }47 }48}49using System;50using System.Collections.Generic;51using System.Linq;52using System.Text;53using System.Threading.Tasks;54using NBi.Core.Analysis.Member;55using System.Data.OleDb;56using System.Data;57using System.Data.Common;58using System.Data.Odbc;59using System.Data.SqlClient;60using System.Data.SqlServerCe;61using System.Data.OleDb;62using System.Data.OracleClient;63using System.Data.SqlTypes;64using System.Data.Sql;65using System.Data.SqlServerCe;66using System.Data.Common;67using System.Text.RegularExpressions;68using System.IO;69using System.Data;70using System.Data.Common;71using System.Data.Odbc;72using System.Data.SqlClient;73using System.Data.SqlServerCe;74using System.Data.OleDb;75using System.Data.OracleClient;

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in MembersAdomdEngine

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful