How to use TabularStructureDiscoveryFactory class of NBi.Core.Structure.Tabular package

Best NBi code snippet using NBi.Core.Structure.Tabular.TabularStructureDiscoveryFactory

TabularStructureDiscoveryFactoryTest.cs

Source:TabularStructureDiscoveryFactoryTest.cs Github

copy

Full Screen

...9{1011 [TestFixture]12 [Category("Olap")]13 public class TabularStructureDiscoveryFactoryTest14 {1516 [Test]17 public void Execute_TabularDateDimensionWithHeighTeenHierarchies_ListStructureContainingSevenTeenElements()18 {19 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());20 var factory = new TabularStructureDiscoveryFactory(conn);21 var cmd = factory.Instantiate(Target.Hierarchies, TargetType.Object,22 new CaptionFilter[] {23 new CaptionFilter(Target.Perspectives, "Internet Operation"),24 new CaptionFilter(Target.Dimensions, "Date")25 });2627 var structs = cmd.Execute();2829 Assert.That(structs.Count(), Is.EqualTo(17));30 }313233 [Test]34 public void Execute_TabularCalendarHierarchyWithSixLevels_ListStructureContainingSixElements()35 {36 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());37 var factory = new TabularStructureDiscoveryFactory(conn);38 var cmd = factory.Instantiate(Target.Levels, TargetType.Object,39 new CaptionFilter[] {40 new CaptionFilter(Target.Perspectives, "Internet Operation"),41 new CaptionFilter(Target.Dimensions, "Date"),42 new CaptionFilter(Target.Hierarchies, "Calendar")43 });44 45 var structs = cmd.Execute();4647 Assert.That(structs.Count(), Is.EqualTo(6));48 }495051 [Test]52 public void Execute_TabularMonthLevelWithTwoProperties_ListStructureContainingNoElement()53 {54 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());55 var factory = new TabularStructureDiscoveryFactory(conn);56 var cmd = factory.Instantiate(Target.Properties, TargetType.Object,57 new CaptionFilter[] {58 new CaptionFilter(Target.Perspectives,"Adventure Works"),59 new CaptionFilter(Target.Dimensions,"Date"),60 new CaptionFilter(Target.Hierarchies,"Calendar"),61 new CaptionFilter(Target.Levels,"Month")62 });63 64 var structs = cmd.Execute();6566 Assert.That(structs.Count(), Is.EqualTo(0));67 }686970 [Test]71 public void Execute_TabularMeasureGroupsForFinance_ThreeElements()72 {73 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());74 var factory = new TabularStructureDiscoveryFactory(conn);75 var cmd = factory.Instantiate(Target.MeasureGroups, TargetType.Object,76 new CaptionFilter[] {77 new CaptionFilter(Target.Perspectives,"Internet Operation"),78 });7980 var structs = cmd.Execute();8182 Assert.That(structs.Count(), Is.EqualTo(3));83 }848586 [Test]87 public void Execute_TabularMeasuresForMeasureGroupInternetSales_SeventeenElements()88 {89 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());90 var factory = new TabularStructureDiscoveryFactory(conn);91 var cmd = factory.Instantiate(Target.Measures, TargetType.Object,92 new CaptionFilter[] {93 new CaptionFilter(Target.Perspectives,"Internet Operation"),94 new CaptionFilter(Target.MeasureGroups,"Internet Sales")95 });9697 var structs = cmd.Execute();9899 Assert.That(structs.Count(), Is.EqualTo(17));100 }101102103 [Test]104 public void Execute_TabularSchemas_FourElements()105 {106 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());107 var factory = new TabularStructureDiscoveryFactory(conn);108 var cmd = factory.Instantiate(Target.Perspectives, TargetType.Object,109 new CaptionFilter[] {110 });111112 var structs = cmd.Execute();113114 Assert.That(structs.Count(), Is.EqualTo(4));115 }116117 [Test]118 public void Execute_TabularTablesForInternetOperation_FifteenElements()119 {120 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());121 var factory = new TabularStructureDiscoveryFactory(conn);122 var cmd = factory.Instantiate(Target.Tables, TargetType.Object,123 new CaptionFilter[] {124 new CaptionFilter(Target.Perspectives,"Internet Operation"),125 });126127 var structs = cmd.Execute();128129 Assert.That(structs.Count(), Is.EqualTo(15));130 }131132 [Test]133 public void Execute_TabularColumnsForInternetSales_TwentySevenElements()134 {135 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());136 var factory = new TabularStructureDiscoveryFactory(conn);137 var cmd = factory.Instantiate(Target.Columns, TargetType.Object,138 new CaptionFilter[] {139 new CaptionFilter(Target.Perspectives,"Internet Operation"),140 new CaptionFilter(Target.Tables,"Internet Sales"),141 });142143 var structs = cmd.Execute();144145 Assert.That(structs.Count(), Is.EqualTo(27));146 }147148 [Test]149 public void Execute_OnSchemaNamedInternetOperation_ListStructureContainingTenTables()150 {151 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());152 var factory = new TabularStructureDiscoveryFactory(conn);153 var cmd = factory.Instantiate(Target.Tables, TargetType.Object,154 new CaptionFilter[] {155 new CaptionFilter(Target.Perspectives, "Internet Operation")});156157 var structs = cmd.Execute();158159 Assert.That(structs.Count(), Is.EqualTo(15));160 }161162 [Test]163 public void Execute_OnTableNamedCurrency_ListStructureContainingThreeColumns()164 {165 var conn = new AdomdConnection(ConnectionStringReader.GetAdomdTabular());166 var factory = new TabularStructureDiscoveryFactory(conn);167 var cmd = factory.Instantiate(Target.Columns, TargetType.Object,168 new CaptionFilter[] {169 new CaptionFilter(Target.Perspectives, "Internet Operation"),170 new CaptionFilter(Target.Tables, "Currency")171 });172173 var structs = cmd.Execute();174175 Assert.That(structs.Count(), Is.EqualTo(3));176 }177178 //[Test]179 //[Ignore]180 //public void Execute_TabularDateDimensionLinkedToThreeMeasureGroups_ListStructureContainingThreeElements() ...

Full Screen

Full Screen

StructureDiscoveryFactoryProvider.cs

Source:StructureDiscoveryFactoryProvider.cs Github

copy

Full Screen

...34 protected virtual void Initialize()35 {36 dico.Add(Olap, typeof(OlapStructureDiscoveryFactory));37 dico.Add(Relational, typeof(RelationalStructureDiscoveryFactory));38 dico.Add(Tabular, typeof(TabularStructureDiscoveryFactory));39 }4041 public IStructureDiscoveryFactory Instantiate(string connectionString)42 {43 var sessionFactory = new ClientProvider();44 var connection = sessionFactory.Instantiate(connectionString).CreateNew() as IDbConnection;45 var dbType = MapConnectionTypeToDatabaseType(connection);4647 if (!dico.Keys.Contains(dbType))48 throw new ArgumentException();4950 var factoryType = dico[dbType];51 var ctor = factoryType.GetConstructor(new Type[]{typeof(IDbConnection)});52 var factory = (IStructureDiscoveryFactory)ctor.Invoke(new object[] { connection }); ...

Full Screen

Full Screen

TabularStructureDiscoveryFactory.cs

Source:TabularStructureDiscoveryFactory.cs Github

copy

Full Screen

...12using NBi.Core.Structure.Olap;1314namespace NBi.Core.Structure.Tabular15{16 class TabularStructureDiscoveryFactory : OlapStructureDiscoveryFactory17 {18 public TabularStructureDiscoveryFactory(IDbConnection connection)19 : base(connection)20 {21 }2223 protected override IDiscoveryCommandBuilder InstantiateBuilder(Target target, TargetType type)24 {25 if (type != TargetType.Object)26 throw new ArgumentOutOfRangeException();2728 switch (target)29 {30 case Target.Perspectives:31 return new PerspectiveDiscoveryCommandBuilder();32 case Target.MeasureGroups: ...

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Structure.Tabular;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 factory = new TabularStructureDiscoveryFactory();12 var discoveryCommand = factory.Instantiate(new DiscoveryRequest()13 {14 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorksDW2012;Integrated Security=True",15 });16 var result = discoveryCommand.Execute();17 Console.WriteLine(result.Rows.Count);18 Console.ReadLine();19 }20 }21}22using NBi.Core.Structure.Tabular;23using System;24using System.Collections.Generic;25using System.Linq;26using System.Text;27using System.Threading.Tasks;28{29 {30 static void Main(string[] args)31 {32 var factory = new TabularStructureDiscoveryFactory();33 var discoveryCommand = factory.Instantiate(new DiscoveryRequest()34 {35 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorksDW2012;Integrated Security=True",36 });37 var result = discoveryCommand.Execute();38 Console.WriteLine(result.Rows.Count);39 Console.ReadLine();40 }41 }42}43using NBi.Core.Structure.Tabular;44using System;45using System.Collections.Generic;46using System.Linq;47using System.Text;48using System.Threading.Tasks;49{50 {51 static void Main(string[] args)52 {53 var factory = new TabularStructureDiscoveryFactory();54 var discoveryCommand = factory.Instantiate(new DiscoveryRequest()55 {56 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorksDW2012;Integrated Security=True",57 });58 var result = discoveryCommand.Execute();59 Console.WriteLine(result.Rows.Count);60 Console.ReadLine();61 }62 }63}64using NBi.Core.Structure.Tabular;65using System;

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Structure.Tabular;2using NBi.Core.Structure;3using NBi.Core.Structure.Tabular;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9using NBi.Core.Structure.Tabular;10using NBi.Core.Structure;11{12 {13 static void Main(string[] args)14 {15 var factory = new TabularStructureDiscoveryFactory();16 var discovery = factory.Instantiate(new DiscoveryRequest17 {18 ConnectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;",19 });20 var result = discovery.Execute();21 foreach (var row in result)22 {23 foreach (var cell in row)24 {25 Console.Write(cell.Value + " ");26 }27 Console.WriteLine();28 }29 }30 }31}

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Structure.Tabular;2using NBi.Core.Structure;3using System;4using System.Collections.Generic;5using System.Linq;6using System.Text;7using System.Threading.Tasks;8{9 {10 static void Main(string[] args)11 {12 var factory = new TabularStructureDiscoveryFactory();13 var discovery = factory.Instantiate(new StructureDiscoveryRequest("DSN=MyDataSource;Catalog=MyCatalog;Provider=SQLNCLI11.1;Integrated Security=SSPI;", DiscoveryTarget.Tables));14 var result = discovery.Execute();15 foreach (var item in result)16 {17 Console.WriteLine(item);18 }19 }20 }21}

Full Screen

Full Screen

TabularStructureDiscoveryFactory

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.Tabular;7{8 {9 static void Main(string[] args)10 {11 var factory = new TabularStructureDiscoveryFactory();12 var command = factory.Instantiate(new TabularStructureDiscoveryRequest()13 {14 ConnectionString = @"Provider=SQLNCLI11;Data Source=.;Integrated Security=SSPI;Initial Catalog=AdventureWorks2012",15 });16 var result = command.Execute();17 Console.WriteLine(result.Rows.Count);18 Console.ReadLine();19 }20 }21}

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1var discoveryFactory = new TabularStructureDiscoveryFactory();2var discoveryCommand = discoveryFactory.Instantiate(new ConnectionStringSettings("connectionString", "Data Source=.;Initial Catalog=AdventureWorksLT;Integrated Security=True;","System.Data.SqlClient"));3var engine = new DiscoveryEngine();4var result = engine.Discover(discoveryCommand);5var table = result.Tables[0];6var discoveryFactory = new TabularMetadataDiscoveryFactory();7var discoveryCommand = discoveryFactory.Instantiate(new ConnectionStringSettings("connectionString", "Data Source=.;Initial Catalog=AdventureWorksLT;Integrated Security=True;","System.Data.SqlClient"));8var engine = new DiscoveryEngine();9var result = engine.Discover(discoveryCommand);10var table = result.Tables[0];

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Structure.Tabular;2using NBi.Core.Structure;3using NBi.Core.Structure.Tabular;4using NBi.Core.Structure;5using NBi.Core.Structure.Tabular;6using NBi.Core.Structure;7using NBi.Core.Structure.Tabular;8using NBi.Core.Structure;9using NBi.Core.Structure.Tabular;10using NBi.Core.Structure;11using NBi.Core.Structure.Tabular;12using NBi.Core.Structure;13using NBi.Core.Structure.Tabular;14using NBi.Core.Structure;

Full Screen

Full Screen

TabularStructureDiscoveryFactory

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using NBi.Core.Structure.Tabular;6using NBi.Core.Structure;7using System.Data.SqlClient;8{9 {10 static void Main(string[] args)11 {12 var connectionString = "Data Source=.;Initial Catalog=AdventureWorksDW2012;Integrated Security=True";13 var tableName = "DimProduct";14 var factory = new TabularStructureDiscoveryFactory();15 var command = factory.Instantiate(new TabularStructureDiscoveryRequest(connectionString, tableName));16 var result = command.Execute();17 foreach (var column in result.Columns)18 Console.WriteLine(column.Name);19 Console.ReadLine();20 }21 }22}23using System;24using System.Collections.Generic;25using System.Linq;26using System.Text;27using NBi.Core.Structure.Tabular;28using NBi.Core.Structure;29using System.Data.SqlClient;30{31 {32 static void Main(string[] args)33 {34 var connectionString = "Data Source=.;Initial Catalog=AdventureWorksDW2012;Integrated Security=True";35 var tableName = "DimProduct";36 var factory = new TabularStructureDiscoveryFactory();37 var command = factory.Instantiate(new TabularStructureDiscoveryRequest(connectionString, tableName));38 var result = command.Execute();39 foreach (var column in result.Columns)40 Console.WriteLine(column.Name);41 Console.WriteLine();42 foreach (var row in result.Rows)43 {44 foreach (var cell in row.Cells)45 Console.Write(cell.Value + " ");46 Console.WriteLine();47 }48 Console.ReadLine();49 }50 }51}

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 methods in TabularStructureDiscoveryFactory

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful