How to use DiscoveryRequestFactory class of NBi.Core.Analysis.Request package

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

ContainsConstraintTest.cs

Source:ContainsConstraintTest.cs Github

copy

Full Screen

...13 [Test]14 public void Matches_GivenMemberCommand_EngineCalledOnceWithParametersComingFromMemberCommand()15 {16 var exp = "Expected member";17 var cmd = new DiscoveryRequestFactory().Build(18 "ConnectionString",19 "member-caption",20 "perspective",21 "dimension",22 null,23 null);2425 var memberStub = new Mock<NBi.Core.Analysis.Member.Member>();26 var member1 = memberStub.Object;27 var member2 = memberStub.Object;28 var members = new MemberResult();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);110 ...

Full Screen

Full Screen

AbstractMembersBuilder.cs

Source:AbstractMembersBuilder.cs Github

copy

Full Screen

...10namespace NBi.NUnit.Builder11{12 abstract class AbstractMembersBuilder : AbstractTestCaseBuilder13 {14 protected readonly DiscoveryRequestFactory discoveryFactory;1516 public AbstractMembersBuilder()17 {18 discoveryFactory = new DiscoveryRequestFactory();19 }2021 public AbstractMembersBuilder(DiscoveryRequestFactory factory)22 {23 discoveryFactory = factory;24 }25 26 protected MembersXml SystemUnderTestXml { get; set; }2728 protected override void BaseSetup(AbstractSystemUnderTestXml sutXml, AbstractConstraintXml ctrXml)29 {30 if (!(sutXml is MembersXml))31 throw new ArgumentException("Constraint must be a 'MembesrXml'");3233 SystemUnderTestXml = (MembersXml)sutXml;34 }35 ...

Full Screen

Full Screen

DiscoveryRequestFactoryTest.cs

Source:DiscoveryRequestFactoryTest.cs Github

copy

Full Screen

...6namespace NBi.Testing.Integration.Core.Analysis.Request7{8 [TestFixture]9 [Category("Olap")]10 public class DiscoveryRequestFactoryTest11 {12 [Test]13 public void Build_MemberCaptionFilled_MemberCaptionIsSet()14 {15 var facto = new DiscoveryRequestFactory();1617 var disco = facto.Build("connectionString", "parent-member", "perspective", "dimension", "hierarchy", null);1819 //Assertion20 Assert.That(disco.MemberCaption, Is.EqualTo("parent-member"));21 }2223 [Test]24 public void Build_MemberCaptionFilled_FunctionIsSetToChildren()25 {26 var facto = new DiscoveryRequestFactory();2728 var disco = facto.Build("connectionString", "parent-member", "perspective", "dimension", "hierarchy", null);2930 //Assertion31 Assert.That(disco.Function.ToLower(), Is.EqualTo("Children".ToLower()));32 }3334 [Test]35 public void Build_MemberCaptionNotFilled_FunctionIsSetToMembers()36 {37 var facto = new DiscoveryRequestFactory();3839 var disco = facto.Build("connectionString", string.Empty, "perspective", "dimension", "hierarchy", null);4041 //Assertion42 Assert.That(disco.Function.ToLower(), Is.EqualTo("Members".ToLower()));43 }44 }45} ...

Full Screen

Full Screen

DiscoveryRequestFactory

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.Request;7using NBi.Core.Analysis.Member;8using NBi.Core.Analysis.Metadata.Adomd;9using NBi.Core.Analysis.Metadata;10using System.Data;11using System.Data.OleDb;12using System.Data.Odbc;13using System.Data.Common;14using System.Data.SqlClient;15using NBi.Core.Analysis.Result;16using NBi.Core.ResultSet;17using NBi.Core.ResultSet.Resolver;18using NBi.Core.ResultSet.Lookup.Violation;19using NBi.Core.ResultSet.Analyzer;20using NBi.Core.ResultSet.Comparer;21using NBi.Core.ResultSet.Equivalence;22using NBi.Core.Calculation;23using NBi.Core.Calculation.Grouping;24using NBi.Core.Calculation.Predicate;25using NBi.Core.Calculation.Ranking;26using NBi.Core.Calculation.Ranking.Percentile;27using NBi.Core.Calculation.Ranking.TopBottom;28using NBi.Core.Calculation.Ranking.Window;29using NBi.Core.Analysis.Request.Factory;30using NBi.Core.Analysis.Request.Factory.Mdx;31using NBi.Core.Analysis.Request.Factory.Adomd;32using NBi.Core.Analysis.Request.Factory.Olap;33using NBi.Core.Analysis.Request.Factory.Olap12;34using NBi.Core.Analysis.Request.Factory.Olap4;35using NBi.Core.Analysis.Request.Factory.Olap2005;36using NBi.Core.Analysis.Request.Factory.Olap2008;37using NBi.Core.Analysis.Request.Factory.Olap2012;38using NBi.Core.Analysis.Request.Factory.Olap2013;39using NBi.Core.Analysis.Request.Factory.Olap2014;40using NBi.Core.Analysis.Request.Factory.Olap2016;41using NBi.Core.Analysis.Request.Factory.Olap2017;42using NBi.Core.Analysis.Request.Factory.Olap2019;43using NBi.Core.Analysis.Request.Factory.Olap2021;44using NBi.Core.Analysis.Request.Factory.Olap2022;45using NBi.Core.Analysis.Request.Factory.Olap2023;46using NBi.Core.Analysis.Request.Factory.Olap2024;47using NBi.Core.Analysis.Request.Factory.Olap2025;48using NBi.Core.Analysis.Request.Factory.Olap2026;49using NBi.Core.Analysis.Request.Factory.Olap2027;

Full Screen

Full Screen

DiscoveryRequestFactory

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2using System;3using System.Collections.Generic;4using System.Linq;5using System.Text;6using System.Threading.Tasks;7using System.Data;8using System.Data.SqlClient;9using NBi.Core.Analysis.Member;10using NBi.Core.Analysis.Metadata.Adomd;11{12 {13 static void Main(string[] args)14 {15 var connectionString = "Data Source=.;Initial Catalog=Adventure Works DW 2008R2;Integrated Security=SSPI;Provider=MSOLAP.4;";16 var factory = new DiscoveryRequestFactory();17 var request = factory.Instantiate("Adventure Works DW 2008R2");18 request.ConnectionString = connectionString;19 var discovery = new MetadataDiscovery();20 var result = discovery.Execute(request);21 Console.WriteLine(result);22 Console.Read();23 }24 }25}

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 DiscoveryRequestFactory

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful