How to use OlapStructureDiscoveryFactory method of NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory class

Best NBi code snippet using NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory.OlapStructureDiscoveryFactory

OlapStructureDiscoveryFactoryTest.cs

Source:OlapStructureDiscoveryFactoryTest.cs Github

copy

Full Screen

...15 [Test]16 public void Execute_Perspective_ListStructureContainingCorrectCountOfElements()17 {18 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());19 var factory = new OlapStructureDiscoveryFactory(conn);20 var cmd = factory.Instantiate(Target.Perspectives, TargetType.Object,21 new CaptionFilter[] {22 });2324 var structs = cmd.Execute();2526 Assert.That(structs.Count(), Is.EqualTo(6));27 }2829 [Test]30 public void Execute_AdventureWorksDimensions_ListStructureContainingNotMeasure()31 {32 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());33 var factory = new OlapStructureDiscoveryFactory(conn);34 var cmd = factory.Instantiate(Target.Dimensions, TargetType.Object,35 new CaptionFilter[] { 36 new CaptionFilter(Target.Perspectives, "Adventure Works")37 });3839 var structs = cmd.Execute();4041 Assert.That(structs, Is.Not.Contains("Measures"));42 }4344 [Test]45 public void Execute_DateDimensionWithHeighTeenHierarchies_ListStructureContainingCorrectCountOfElements()46 {47 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());48 var factory = new OlapStructureDiscoveryFactory(conn);49 var cmd = factory.Instantiate(Target.Hierarchies, TargetType.Object,50 new CaptionFilter[] { 51 new CaptionFilter(Target.Perspectives, "Adventure Works"),52 new CaptionFilter(Target.Dimensions, "Date")53 });5455 var structs = cmd.Execute();5657 Assert.That(structs.Count(), Is.EqualTo(18));58 }5960 [Test]61 public void Execute_CalendarHierarchyWithSixLevels_ListStructureContainingCorrectCountOfElements()62 {63 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());64 var factory = new OlapStructureDiscoveryFactory(conn);65 var cmd = factory.Instantiate(Target.Levels, TargetType.Object,66 new CaptionFilter[] {67 new CaptionFilter(Target.Perspectives,"Adventure Works"),68 new CaptionFilter(Target.Dimensions,"Date"),69 new CaptionFilter(Target.Hierarchies,"Calendar")70 });7172 var structs = cmd.Execute();7374 Assert.That(structs.Count(), Is.EqualTo(6));75 }7677 [Test]78 public void Execute_MonthLevelWithTwoProperties_ListStructureContainingCorrectCountOfElements()79 {80 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());81 var factory = new OlapStructureDiscoveryFactory(conn);82 var cmd = factory.Instantiate(Target.Properties, TargetType.Object,83 new CaptionFilter[] {84 new CaptionFilter(Target.Perspectives,"Adventure Works"),85 new CaptionFilter(Target.Dimensions,"Date"),86 new CaptionFilter(Target.Hierarchies,"Calendar"),87 new CaptionFilter(Target.Levels,"Month")88 });89 90 var structs = cmd.Execute();9192 Assert.That(structs.Count(), Is.EqualTo(2));93 }9495 [Test]96 public void Execute_MeasureGroupsForCubeFinance_CorrectCountOfElements()97 {98 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());99 var factory = new OlapStructureDiscoveryFactory(conn);100 var cmd = factory.Instantiate(Target.MeasureGroups, TargetType.Object,101 new CaptionFilter[] {102 new CaptionFilter(Target.Perspectives,"Finance"),103 });104 105 var structs = cmd.Execute();106107 Assert.That(structs.Count(), Is.EqualTo(2));108 }109110 [Test]111 public void Execute_MeasuresForMeasureGroupInternetSales_CorrectCountOfElements()112 {113 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());114 var factory = new OlapStructureDiscoveryFactory(conn);115 var cmd = factory.Instantiate(Target.Measures, TargetType.Object,116 new CaptionFilter[] {117 new CaptionFilter(Target.Perspectives,"Adventure Works"),118 new CaptionFilter(Target.MeasureGroups,"Internet Sales")119 });120121 var structs = cmd.Execute();122123 Assert.That(structs.Count(), Is.EqualTo(14));124 }125126 [Test]127 public void Execute_SetsWithPerspective_ListStructureContainingCorrectCountOfElements()128 {129 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());130 var factory = new OlapStructureDiscoveryFactory(conn);131 var cmd = factory.Instantiate(Target.Sets, TargetType.Object,132 new CaptionFilter[] { 133 new CaptionFilter(Target.Perspectives, "Channel Sales")134 });135136 var structs = cmd.Execute();137138 Assert.That(structs.Count(), Is.EqualTo(4));139 }140141 [Test]142 public void Execute_DateDimensionLinkedTo_ListStructureContainingTenElements()143 {144 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());145 var factory = new OlapStructureDiscoveryFactory(conn);146 var cmd = factory.Instantiate(Target.MeasureGroups, TargetType.Relation,147 new CaptionFilter[] { 148 new CaptionFilter(Target.Perspectives, "Adventure Works")149 , new CaptionFilter(Target.Dimensions, "Date")150 });151152 var structs = cmd.Execute();153154 Assert.That(structs.Count(), Is.EqualTo(10));155 }156157 [Test]158 public void Execute_MeasureGroupSalesOrdersLinkedTo_ListStructureContainingCorrectCountOfElements()159 {160 var conn = new AdomdConnection(ConnectionStringReader.GetAdomd());161 var factory = new OlapStructureDiscoveryFactory(conn);162 var cmd = factory.Instantiate(Target.Dimensions, TargetType.Relation,163 new CaptionFilter[] { 164 new CaptionFilter(Target.Perspectives, "Adventure Works")165 , new CaptionFilter(Target.MeasureGroups, "Sales Orders")166 });167168 var structs = cmd.Execute();169170 Assert.That(structs.Count(), Is.EqualTo(9));171 }172173174 }175 ...

Full Screen

Full Screen

OlapStructureDiscoveryFactory.cs

Source:OlapStructureDiscoveryFactory.cs Github

copy

Full Screen

...11using NBi.Core.Structure.Tabular.Builders;1213namespace NBi.Core.Structure.Olap14{15 class OlapStructureDiscoveryFactory : IStructureDiscoveryFactory16 {17 private readonly AdomdConnection connection;18 public OlapStructureDiscoveryFactory(IDbConnection connection)19 {20 this.connection = connection as AdomdConnection;21 }2223 public StructureDiscoveryCommand Instantiate(Target target, TargetType type, IEnumerable<IFilter> filters)24 {25 if (!(connection is AdomdConnection))26 throw new ArgumentException();2728 var builder = InstantiateBuilder(target, type);29 builder.Build(filters);3031 var cmd = connection.CreateCommand();32 cmd.CommandText = builder.GetCommandText(); ...

Full Screen

Full Screen

ExistsConstraintTest.cs

Source:ExistsConstraintTest.cs Github

copy

Full Screen

...44 [Test, Category("Olap cube")]45 public void ExistsConstraint_ExistingPerspectiveButWrongCaseWithIgnoreCaseFalse_Failure()46 {47 var connection = new AdomdConnection(ConnectionStringReader.GetAdomd());48 var factory = new OlapStructureDiscoveryFactory(connection);49 var command = factory.Instantiate(50 Target.Perspectives51 , TargetType.Object52 , new CaptionFilter[] { 53 });5455 var ctr = new ExistsConstraint("Adventure Works".ToLower());5657 //Method under test58 Assert.Throws<AssertionException>(delegate { Assert.That(command, ctr); });59 }6061 [Test, Category("Olap cube")]62 public void ExistsConstraint_ExistingPerspectiveButWrongCaseWithIgnoreCaseTrue_Success()63 {64 var connection = new AdomdConnection(ConnectionStringReader.GetAdomd());65 var factory = new OlapStructureDiscoveryFactory(connection);66 var command = factory.Instantiate(67 Target.Perspectives68 , TargetType.Object69 , new CaptionFilter[] { 70 });7172 var ctr = new ExistsConstraint("Adventure Works".ToLower());73 ctr = ctr.IgnoreCase;7475 //Method under test76 Assert.That(command, ctr);77 }7879 } ...

Full Screen

Full Screen

OlapStructureDiscoveryFactory

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.Structure.Olap;7using NBi.Core.Structure;8using NBi.Core.Structure.Olap.Builders;9using NBi.Core.Structure.Olap.Factory;10using NBi.Core.Scalar.Resolver;11using NBi.Core.Calculation.Grouping;12using NBi.Core.Calculation;13using NBi.Core.Calculation.Predicate;14using NBi.Core.Calculation.Ranking;15using NBi.Core.Calculation.Ranking.Percentile;16using NBi.Core.Calculation.Ranking.TopBottom;17using System.Data;18using NBi.Core.ResultSet;19using NBi.Core.ResultSet.Analyzer;20using NBi.Core.ResultSet.Comparer;21using NBi.Core.ResultSet.Resolver;22using NBi.Core.ResultSet.Lookup.Violation;23using NBi.Core.ResultSet.Lookup;24{25 {26 static void Main(string[] args)27 {28 var factory = new OlapStructureDiscoveryFactory();29 var discovery = factory.Instantiate(new CaptionFilter("Adventure Works"));30 var command = discovery.GetCommand();31 Console.WriteLine(command.CommandText);32 Console.ReadKey();33 }34 }35}36using System;37using System.Collections.Generic;38using System.Linq;39using System.Text;40using System.Threading.Tasks;41using NBi.Core.Structure.Olap;42using NBi.Core.Structure;43using NBi.Core.Structure.Olap.Builders;44using NBi.Core.Structure.Olap.Factory;45using NBi.Core.Scalar.Resolver;46using NBi.Core.Calculation.Grouping;47using NBi.Core.Calculation;48using NBi.Core.Calculation.Predicate;49using NBi.Core.Calculation.Ranking;50using NBi.Core.Calculation.Ranking.Percentile;51using NBi.Core.Calculation.Ranking.TopBottom;52using System.Data;53using NBi.Core.ResultSet;54using NBi.Core.ResultSet.Analyzer;55using NBi.Core.ResultSet.Comparer;56using NBi.Core.ResultSet.Resolver;57using NBi.Core.ResultSet.Lookup.Violation;58using NBi.Core.ResultSet.Lookup;59{60 {61 static void Main(string[] args)62 {63 var factory = new OlapStructureDiscoveryFactory();

Full Screen

Full Screen

OlapStructureDiscoveryFactory

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.Structure.Olap;7{8 {9 static void Main(string[] args)10 {11 var factory = new OlapStructureDiscoveryFactory();12 var result = discovery.Execute();13 Console.WriteLine(result.Rows.Count);14 Console.ReadLine();15 }16 }17}

Full Screen

Full Screen

OlapStructureDiscoveryFactory

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.Structure.Olap;7{8 {9 static void Main(string[] args)10 {11 OlapStructureDiscoveryFactory osdf = new OlapStructureDiscoveryFactory();12 osdf.Discover();13 }14 }15}

Full Screen

Full Screen

OlapStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Structure.Olap;2using NBi.Core.Structure.Olap.Builders;3using NBi.Core.Structure.Olap.Factory;4using NBi.Core.Structure.Olap.Providers;5using NBi.Core.Structure;6using System;7using System.Collections.Generic;8using System.Linq;9using System.Text;10using System.Threading.Tasks;11{12 {13 static void Main(string[] args)14 {15 var catalog = "Adventure Works";16 var provider = new AdomdStructureDiscoveryProvider(connectionString, catalog);17 var builder = new StructureDiscoveryRequestBuilder();18 builder.Setup(x => x.Provider).Using(provider);19 builder.Setup(x => x.DiscoverLevel).Using("Date");20 var request = builder.GetRequest();21 var factory = new OlapStructureDiscoveryFactory();22 var discovery = factory.Instantiate(request);23 var result = discovery.Execute();24 Console.WriteLine(result);25 Console.ReadLine();26 }27 }28}29using NBi.Core.Structure.Olap;30using NBi.Core.Structure.Olap.Builders;31using NBi.Core.Structure.Olap.Factory;32using NBi.Core.Structure.Olap.Providers;33using NBi.Core.Structure;34using System;35using System.Collections.Generic;36using System.Linq;37using System.Text;38using System.Threading.Tasks;39{40 {41 static void Main(string[] args)42 {43 var catalog = "Adventure Works";44 var provider = new AdomdStructureDiscoveryProvider(connectionString, catalog);45 var builder = new StructureDiscoveryRequestBuilder();46 builder.Setup(x => x.Provider).Using(provider);47 builder.Setup(x => x.DiscoverLevel).Using("Date");48 var request = builder.GetRequest();49 var factory = new OlapStructureDiscoveryFactory();50 var discovery = factory.Instantiate(request);51 var result = discovery.Execute();52 Console.WriteLine(result);53 Console.ReadLine();54 }55 }56}

Full Screen

Full Screen

OlapStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using System;2using NBi.Core.Structure.Olap;3using NBi.Core.Structure;4{5 {6 static void Main(string[] args)7 {8 var factory = new OlapStructureDiscoveryFactory();9 var command = new OlapStructureDiscoveryCommand(discovery);10 var result = command.Execute();11 foreach (var item in result)12 {13 Console.WriteLine(item);14 }

Full Screen

Full Screen

OlapStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Text;4using NBi.Core.Structure.Olap;5using NBi.Core.Structure;6using NBi.Core.Structure.Olap.Builders;7{8 {9 static void Main(string[] args)10 {11 var factory = new OlapStructureDiscoveryFactory();12 var command = new OlapStructureDiscoveryCommand(OlapStructureDiscoveryFactory.DiscoveryType.Cubes);13 var discovery = factory.Instantiate(command);14 discovery.ConnectionString = connectionString;15 var res = discovery.Execute();16 foreach (var item in res)17 {18 Console.WriteLine(item);19 }20 Console.Read();21 }22 }23}24using System;25using System.Collections.Generic;26using System.Text;27using NBi.Core.Structure.Olap;28using NBi.Core.Structure;29using NBi.Core.Structure.Olap.Builders;30{31 {32 static void Main(string[] args)33 {34 var factory = new OlapStructureDiscoveryFactory();35 var command = new OlapStructureDiscoveryCommand(OlapStructureDiscoveryFactory.DiscoveryType.Dimensions);36 var discovery = factory.Instantiate(command);37 discovery.ConnectionString = connectionString;38 var res = discovery.Execute();39 foreach (var item in res)40 {41 Console.WriteLine(item);42 }43 Console.Read();44 }45 }46}47using System;48using System.Collections.Generic;49using System.Text;50using NBi.Core.Structure.Olap;51using NBi.Core.Structure;52using NBi.Core.Structure.Olap.Builders;53{54 {55 static void Main(string[] args)56 {57 var connectionString = "Provider=MSOLAP;Data Source

Full Screen

Full Screen

OlapStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1{2 {3 static void Main(string[] args)4 {5 var connectionString = new NBi.Core.ConnectionString.NBiConnectionStringBuilder();6 connectionString.Add("Provider", "MSSQL");7 connectionString.Add("Data Source", "localhost");8 connectionString.Add("Initial Catalog", "Adventure Works DW 2008R2");9 connectionString.Add("Integrated Security", true);10 connectionString.Add("CommandTimeout", 0);11 var factory = new NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory();12 var command = factory.Instantiate(NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory.Discovery.MdxMetadata, connectionString.ConnectionString);13 var result = command.Execute();14 Console.WriteLine(result.Rows.Count);15 Console.ReadKey();16 }17 }18}19{20 {21 static void Main(string[] args)22 {23 var connectionString = new NBi.Core.ConnectionString.NBiConnectionStringBuilder();24 connectionString.Add("Provider", "MSSQL");25 connectionString.Add("Data Source", "localhost");26 connectionString.Add("Initial Catalog", "Adventure Works DW 2008R2");27 connectionString.Add("Integrated Security", true);28 connectionString.Add("CommandTimeout", 0);29 var factory = new NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory();30 var command = factory.Instantiate(NBi.Core.Structure.Olap.OlapStructureDiscoveryFactory.Discovery.MdxMetadata, connectionString.ConnectionString);31 var result = command.Execute();32 foreach (var row in result.Rows)33 {34 Console.WriteLine(row["Caption"] + " " + row["Type"]);35 }36 Console.ReadKey();37 }38 }39}

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 OlapStructureDiscoveryFactory

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful