How to use BuildRelation method of NBi.Core.Analysis.Request.DiscoveryRequestFactory class

Best NBi code snippet using NBi.Core.Analysis.Request.DiscoveryRequestFactory.BuildRelation

LinkedToConstraintTest.cs

Source:LinkedToConstraintTest.cs Github

copy

Full Screen

...4142 [Test, Category("Olap cube")]43 public void LinkedToConstraint_ExistingPerspectiveDimensionAndMeasureGroupLinked_Success()44 {45 var discovery = new DiscoveryRequestFactory().BuildRelation(46 ConnectionStringReader.GetAdomd()47 , DiscoveryTarget.MeasureGroups48 , new List<IFilter>() { 49 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)50 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)51 });5253 var ctr = new LinkedToConstraint("Internet Sales");5455 //Method under test56 Assert.That(discovery, ctr);57 }5859 [Test, Category("Olap cube")]60 public void LinkedToConstraint_ExistingPerspectiveDimensionAndMeasureGroupLinkedWithoutCaseMatching_Success()61 {62 var discovery = new DiscoveryRequestFactory().BuildRelation(63 ConnectionStringReader.GetAdomd()64 , DiscoveryTarget.MeasureGroups65 , new List<IFilter>() { 66 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)67 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)68 });6970 var ctr = new LinkedToConstraint("Internet Sales".ToLower());71 ctr = ctr.IgnoreCase;7273 //Method under test74 Assert.That(discovery, ctr);75 }7677 [Test, Category("Olap cube")]78 public void LinkedToConstraint_ExistingPerspectiveDimensionAndNotExistingMeasureGroup_Failure()79 {80 var discovery = new DiscoveryRequestFactory().BuildRelation(81 ConnectionStringReader.GetAdomd()82 , DiscoveryTarget.MeasureGroups83 , new List<IFilter>() { 84 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)85 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)86 });8788 var ctr = new LinkedToConstraint("Not existing");8990 //Method under test91 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });92 }9394 [Test, Category("Olap cube")]95 public void LinkedToConstraint_ExistingPerspectiveNotExistingDimensionAndExistingMeasureGroup_Failure()96 {97 var discovery = new DiscoveryRequestFactory().BuildRelation(98 ConnectionStringReader.GetAdomd()99 , DiscoveryTarget.MeasureGroups100 , new List<IFilter>() { 101 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)102 , new CaptionFilter("Not existing", DiscoveryTarget.Dimensions)103 });104105 var ctr = new LinkedToConstraint("Reseller Sales");106107 //Method under test108 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });109 }110111 [Test, Category("Olap cube")]112 public void LinkedToConstraint_NotExistingPerspectiveExistingDimensionAndExistingMeasureGroup_Failure()113 {114 var discovery = new DiscoveryRequestFactory().BuildRelation(115 ConnectionStringReader.GetAdomd()116 , DiscoveryTarget.MeasureGroups117 , new List<IFilter>() { 118 new CaptionFilter("Not existing", DiscoveryTarget.Perspectives)119 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)120 });121122 var ctr = new LinkedToConstraint("Internet Sales");123124 //Method under test125 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });126 }127128 [Test, Category("Olap cube")]129 public void LinkedToConstraint_ExistingPerspectiveDimensionAndExistingMeasureGroupButNotLinked_Failure()130 {131 var discovery = new DiscoveryRequestFactory().BuildRelation(132 ConnectionStringReader.GetAdomd()133 , DiscoveryTarget.MeasureGroups134 , new List<IFilter>() { 135 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)136 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)137 });138139 var ctr = new LinkedToConstraint("Reseller Sales");140141 //Method under test142 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });143 }144145 //Measure-group146147 [Test, Category("Olap cube")]148 public void LinkedToConstraint_ExistingPerspectiveMeasureGroupAndDimensionLinked_Success()149 {150 var discovery = new DiscoveryRequestFactory().BuildRelation(151 ConnectionStringReader.GetAdomd()152 , DiscoveryTarget.Dimensions153 , new List<IFilter>() { 154 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)155 , new CaptionFilter("Internet Sales", DiscoveryTarget.MeasureGroups)156 });157158 var ctr = new LinkedToConstraint("Customer");159160 //Method under test161 Assert.That(discovery, ctr);162 }163164 [Test, Category("Olap cube")]165 public void LinkedToConstraint_ExistingPerspectiveMeasureGroupAndNotExistingDimension_Failure()166 {167 var discovery = new DiscoveryRequestFactory().BuildRelation(168 ConnectionStringReader.GetAdomd()169 , DiscoveryTarget.Dimensions170 , new List<IFilter>() { 171 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)172 , new CaptionFilter("Internet Sales", DiscoveryTarget.MeasureGroups)173 });174175 var ctr = new LinkedToConstraint("Not existing");176177 //Method under test178 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });179 }180181 [Test, Category("Olap cube")]182 public void LinkedToConstraint_ExistingPerspectiveNotExistingMeasureGroupAndExistingDimension_Failure()183 {184 var discovery = new DiscoveryRequestFactory().BuildRelation(185 ConnectionStringReader.GetAdomd()186 , DiscoveryTarget.Dimensions187 , new List<IFilter>() { 188 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)189 , new CaptionFilter("Not existing", DiscoveryTarget.MeasureGroups)190 });191192 var ctr = new LinkedToConstraint("Customer");193194 //Method under test195 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });196 }197198 [Test, Category("Olap cube")]199 public void LinkedToConstraint_NotExistingPerspectiveExistingMeasureGroupAndExistingDimension_Failure()200 {201 var discovery = new DiscoveryRequestFactory().BuildRelation(202 ConnectionStringReader.GetAdomd()203 , DiscoveryTarget.Dimensions204 , new List<IFilter>() { 205 new CaptionFilter("Not existing", DiscoveryTarget.Perspectives)206 , new CaptionFilter("Internet Sales", DiscoveryTarget.MeasureGroups)207 });208209 var ctr = new LinkedToConstraint("Customer");210211 //Method under test212 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });213 }214215 [Test, Category("Olap cube")]216 public void LinkedToConstraint_ExistingPerspectiveMeasureGroupAndExistingDimensionButNotLinked_Failure()217 {218 var discovery = new DiscoveryRequestFactory().BuildRelation(219 ConnectionStringReader.GetAdomd()220 , DiscoveryTarget.Dimensions221 , new List<IFilter>() { 222 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)223 , new CaptionFilter("Reseller Sales", DiscoveryTarget.MeasureGroups)224 });225226 var ctr = new LinkedToConstraint("Customer");227228 //Method under test229 Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });230 }231232 } ...

Full Screen

Full Screen

AdomdDiscoveryCommandTest.cs

Source:AdomdDiscoveryCommandTest.cs Github

copy

Full Screen

...169170 [Test]171 public void Execute_DateDimensionLinkedToElevenMeasureGroups_ListStructureContainingTenElements()172 {173 var disco = new DiscoveryRequestFactory().BuildRelation(174 ConnectionStringReader.GetAdomd()175 , DiscoveryTarget.MeasureGroups176 , new List<IFilter>() { 177 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)178 , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)179 });180181 var factory = new AdomdDiscoveryCommandFactory();182 var cmd = factory.BuildExact(disco);183184 var structs = cmd.Execute();185186 Assert.That(structs.Count(), Is.EqualTo(10));187 }188189 [Test]190 [Ignore]191 public void Execute_TabularDateDimensionLinkedToThreeMeasureGroups_ListStructureContainingThreeElements()192 {193 var disco = new DiscoveryRequestFactory().BuildRelation(194 ConnectionStringReader.GetAdomd()195 , DiscoveryTarget.MeasureGroups196 , new List<IFilter>() { 197 new CaptionFilter("Internet Operation", DiscoveryTarget.Perspectives)198 , new CaptionFilter("Date", DiscoveryTarget.Dimensions)199 });200201 var factory = new AdomdDiscoveryCommandFactory();202 var cmd = factory.BuildExact(disco);203204 var structs = cmd.Execute();205206 Assert.That(structs.Count(), Is.EqualTo(3));207 } ...

Full Screen

Full Screen

DiscoveryRequestFactory.cs

Source:DiscoveryRequestFactory.cs Github

copy

Full Screen

...7879 return disco;80 }8182 public virtual MetadataDiscoveryRequest BuildRelation(string connectionString, DiscoveryTarget target, IEnumerable<IFilter> filters)83 {84 //Validations85 Validate(86 new List<Validation>()87 {88 new ConnectionStringNotEmpty(connectionString),89 new PerspectiveNotNull(filters),90 new AtLeastOneNotNull(filters, DiscoveryTarget.Dimensions, DiscoveryTarget.MeasureGroups)91 }92 );9394 //If validation of parameters is successfull then we build the object95 var disco = new MetadataLinkedToDiscoveryRequest(connectionString, target, filters);96 return disco; ...

Full Screen

Full Screen

BuildRelation

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using NBi.Core.Analysis.Request;6using NBi.Core.Analysis.Member;7using NBi.Core.Analysis.Metadata;8using NBi.Core.Analysis.Metadata.Adomd;9using NBi.Core.Analysis.Relational;10using NBi.Core.Analysis.Relational.Builders;11using NBi.Core.Analysis.Relational.Command;12using NBi.Core.Analysis.Request.Factory;13using NBi.Core.Analysis.Request.Factory.Adomd;14{15 {16 static void Main(string[] args)17 {18 DiscoveryRequest request = new DiscoveryRequest("Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works");19 IRelationBuilder builder = new AdomdRelationBuilder();20 IRelationCommand command = new AdomdRelationCommand();21 IRelationFactory factory = new AdomdRelationFactory(builder, command);22 DiscoveryRequestFactory factory2 = new DiscoveryRequestFactory(factory);23 factory2.BuildRelation(request, "Date");24 Console.ReadKey();25 }26 }27}28using System;29using System.Collections.Generic;30using System.Linq;31using System.Text;32using NBi.Core.Analysis.Request;33using NBi.Core.Analysis.Member;34using NBi.Core.Analysis.Metadata;35using NBi.Core.Analysis.Metadata.Adomd;36using NBi.Core.Analysis.Relational;37using NBi.Core.Analysis.Relational.Builders;38using NBi.Core.Analysis.Relational.Command;39using NBi.Core.Analysis.Request.Factory;40using NBi.Core.Analysis.Request.Factory.Adomd;41{42 {43 static void Main(string[] args)44 {45 DiscoveryRequest request = new DiscoveryRequest("Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works");

Full Screen

Full Screen

BuildRelation

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2using NBi.Core.Analysis.Member;3using NBi.Core.Analysis.Metadata;4using NBi.Core.Analysis.Metadata.Adomd;5using NBi.Core.Analysis.Request;6using NBi.Core.Analysis.Request.Factory;7using NBi.Core.Analysis.Request.Resolver;8using NBi.Core.Calculation;9using NBi.Core.Calculation.Predicate;10using NBi.Core.Calculation.Predicate.Numeric;11using NBi.Core.Calculation.Resolver;12using NBi.Core.Calculation.Resolver.Numeric;13using NBi.Core.Calculation.Resolver.Text;14using NBi.Core.Calculation.Sequence;15using NBi.Core.Calculation.Sequence.Resolver;16using NBi.Core.Calculation.Sequence.Resolver.Numeric;17using NBi.Core.Calculation.Sequence.Resolver.Text;18using NBi.Core.ResultSet;19using NBi.Core.ResultSet.Comparer;20using NBi.Core.Scalar.Casting;21using NBi.Core.Scalar.Comparer;22using NBi.Core.Scalar.Duration;23using NBi.Core.Variable;24using NBi.Core.Xml;25using NBi.Core.Xml.Constraints;26using NBi.Core.Xml.Settings;27using NBi.Extensibility;28using NBi.Extensibility.Query;29using NBi.Extensibility.Query.Command;30using NBi.Extensibility.Query.Client;31using NBi.Extensibility.Query.Command;32using NBi.Extensibility.Query.Client;33using NBi.Xml;34using NBi.Xml.Constraints;35using NBi.Xml.Items;36using NBi.Xml.Items.Calculation;37using NBi.Xml.Items.Calculation.Grouping;38using NBi.Xml.Items.Calculation.Sequence;39using NBi.Xml.Items.Calculation.Text;40using NBi.Xml.Items.ResultSet;41using NBi.Xml.Items.ResultSet.Lookup;42using NBi.Xml.Items.ResultSet.Lookup.Vba;43using NBi.Xml.Items.ResultSet.Lookup.Xml;44using NBi.Xml.Items.ResultSet.Comparer;45using NBi.Xml.Items.ResultSet.Comparer.Strategy;46using NBi.Xml.Items.ResultSet.Comparer.Strategy.Numeric;47using NBi.Xml.Items.ResultSet.Comparer.Strategy.Text;48using NBi.Xml.Items.ResultSet.Filter;49using NBi.Xml.Items.ResultSet.Lookup;50using NBi.Xml.Items.ResultSet.Lookup.Vba;51using NBi.Xml.Items.ResultSet.Lookup.Xml;52using NBi.Xml.Items.ResultSet.Lookup.Xml.Strategies;53using NBi.Xml.Items.ResultSet.Lookup.Xml.Strategies;54using NBi.Xml.Settings;55using System;56using System.Collections.Generic;57using System.IO;

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 DiscoveryRequestFactory

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful