How to use GetTarget method of NBi.NUnit.Builder.MetadataDiscoveryRequestBuilder class

Best NBi code snippet using NBi.NUnit.Builder.MetadataDiscoveryRequestBuilder.GetTarget

MetadataDiscoveryRequestBuilder.cs

Source:MetadataDiscoveryRequestBuilder.cs Github

copy

Full Screen

...2425 return (string)propertyInfo.GetValue(src, null);26 }2728 private DiscoveryTarget GetTarget(object item)29 {30 if (item is MeasuresXml || item is MeasureXml)31 return DiscoveryTarget.Measures;32 if (item is MeasureGroupsXml || item is MeasureGroupXml)33 return DiscoveryTarget.MeasureGroups;34 if (item is PropertiesXml || item is PropertyXml)35 return DiscoveryTarget.Properties;36 if (item is LevelsXml || item is LevelXml)37 return DiscoveryTarget.Levels;38 if (item is HierarchiesXml || item is HierarchyXml)39 return DiscoveryTarget.Hierarchies;40 if (item is DimensionsXml || item is DimensionXml)41 return DiscoveryTarget.Dimensions;42 if (item is ColumnsXml || item is ColumnXml)43 return DiscoveryTarget.Columns;44 if (item is TablesXml || item is TableXml)45 return DiscoveryTarget.Tables;46 if (item is PerspectivesXml || item is PerspectiveXml)47 return DiscoveryTarget.Perspectives;48 if (item is SetsXml || item is SetXml)49 return DiscoveryTarget.Sets;50 throw new ArgumentException();51 }5253 private DiscoveryTarget GetTargetRelation(object item)54 {55 if (item is MeasureGroupsXml || item is MeasureGroupXml)56 return DiscoveryTarget.Dimensions;57 if (item is DimensionsXml || item is DimensionXml)58 return DiscoveryTarget.MeasureGroups;5960 throw new ArgumentException();61 }6263 private DiscoveryTarget GetTargetForProperty(string propertyName)64 {65 if (propertyName == "DisplayFolder")66 return DiscoveryTarget.DisplayFolders;67 if (propertyName=="MeasureGroup")68 return DiscoveryTarget.MeasureGroups;69 if (propertyName == "Level")70 return DiscoveryTarget.Levels;71 if (propertyName == "Hierarchy")72 return DiscoveryTarget.Hierarchies;73 if (propertyName == "Dimension")74 return DiscoveryTarget.Dimensions;75 if (propertyName == "Table")76 return DiscoveryTarget.Tables;77 if (propertyName == "Perspective")78 return DiscoveryTarget.Perspectives;7980 throw new ArgumentException();81 }8283 private IFilter BuildCaptionFilter(object src, string propertyName)84 {85 var caption = GetPropertyValue(src, propertyName);86 if (string.IsNullOrEmpty(caption))87 return null;8889 var target = GetTargetForProperty(propertyName);90 var filter = new CaptionFilter(caption, target);91 return filter;9293 }9495 private IFilter BuildCaptionFilterForCaptionProperty(object src, DiscoveryTarget target)96 {97 var caption = GetPropertyValue(src, "Caption");98 if (string.IsNullOrEmpty(caption))99 return null;100101 var filter = new CaptionFilter(caption, target);102 return filter;103 }104105 internal MetadataDiscoveryRequest Build(AbstractItem item, MetadataDiscoveryRequestType type)106 {107 var properties = new string[] { "Perspective", "Dimension", "Hierarchy", "Level", "Property", "MeasureGroup", "DisplayFolder", "Measure", "Table", "Column" };108109 IFilter filter = null;110 var filters = new List<IFilter>();111 foreach (var property in properties)112 {113 filter = BuildCaptionFilter(item, property);114 if (filter != null)115 filters.Add(filter);116 }117118 var target = GetTarget(item);119120 filter = BuildCaptionFilterForCaptionProperty(item, target);121 if (filter != null)122 filters.Add(filter);123124 var connectionString = new ConnectionStringHelper().Execute(item, Xml.Settings.SettingsXml.DefaultScope.SystemUnderTest);125126 var factory = new DiscoveryRequestFactory();127 MetadataDiscoveryRequest request = null;128 switch (type)129 {130 case MetadataDiscoveryRequestType.Direct:131 request = factory.BuildDirect(connectionString, target, filters);132 break;133 case MetadataDiscoveryRequestType.Relation:134 target = GetTargetRelation(item);135 request = factory.BuildRelation(connectionString, target, filters);136 break;137 default:138 break;139 }140 return request;141 } 142143 144 }145} ...

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using NBi.NUnit.Builder;2using NBi.NUnit.Query;3using NUnit.Framework;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9{10 {11 public void GetTarget_DatabaseNameOnly_ReturnsDatabase()12 {13 var builder = new MetadataDiscoveryRequestBuilder();14 builder.Setup("database", "AdventureWorks2012");15 var target = builder.GetTarget();16 Assert.That(target, Is.EqualTo("AdventureWorks2012"));17 }18 public void GetTarget_DatabaseAndSchemaName_ReturnsDatabaseAndSchema()19 {20 var builder = new MetadataDiscoveryRequestBuilder();21 builder.Setup("database", "AdventureWorks2012");22 builder.Setup("schema", "HumanResources");23 var target = builder.GetTarget();24 Assert.That(target, Is.EqualTo("AdventureWorks2012.HumanResources"));25 }26 public void GetTarget_DatabaseAndTableName_ReturnsDatabaseAndTable()27 {28 var builder = new MetadataDiscoveryRequestBuilder();29 builder.Setup("database", "AdventureWorks2012");30 builder.Setup("table", "Employee");31 var target = builder.GetTarget();32 Assert.That(target, Is.EqualTo("AdventureWorks2012.Employee"));33 }34 public void GetTarget_DatabaseAndSchemaAndTableName_ReturnsDatabaseAndSchemaAndTable()35 {36 var builder = new MetadataDiscoveryRequestBuilder();37 builder.Setup("database", "AdventureWorks2012");38 builder.Setup("schema", "HumanResources");39 builder.Setup("table", "Employee");40 var target = builder.GetTarget();41 Assert.That(target, Is.EqualTo("AdventureWorks2012.HumanResources.Employee"));42 }43 public void GetTarget_DatabaseAndSchemaAndTableNameAndColumnName_ReturnsDatabaseAndSchemaAndTableAndColumn()44 {45 var builder = new MetadataDiscoveryRequestBuilder();46 builder.Setup("database", "AdventureWorks2012");47 builder.Setup("schema", "HumanResources");48 builder.Setup("table", "Employee");49 builder.Setup("column", "EmployeeId");50 var target = builder.GetTarget();51 Assert.That(target, Is.EqualTo("AdventureWorks2012.HumanResources.Employee.EmployeeId"));52 }53 }54}

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using NBi.NUnit.Builder;2using NBi.NUnit.Runtime;3using NBi.NUnit.Runtime.Configuration;4using NUnit.Framework;5using System;6using System.Collections.Generic;7using System.Linq;8using System.Text;9using System.Threading.Tasks;10using System.Xml;11{12 {13 public void GetTarget_CubeName_CubeName()14 {15 <connectionString>Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW Standard Edition 2008R2;Integrated Security=SSPI;Persist Security Info=False;</connectionString>16 </metadata-discovery-request>";17 var doc = new XmlDocument();18 doc.LoadXml(xml);19 var builder = new MetadataDiscoveryRequestBuilder(doc.DocumentElement);20 var request = builder.GetTarget();21 Assert.That(request.CubeName, Is.EqualTo("Adventure Works"));22 }23 public void GetTarget_ConnectionString_ConnectionString()24 {25 <connectionString>Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW Standard Edition 2008R2;Integrated Security=SSPI;Persist Security Info=False;</connectionString>26 </metadata-discovery-request>";27 var doc = new XmlDocument();28 doc.LoadXml(xml);29 var builder = new MetadataDiscoveryRequestBuilder(doc.DocumentElement);30 var request = builder.GetTarget();31 Assert.That(request.ConnectionString, Is.EqualTo("Provider=MSOLAP;Data Source=.;Initial Catalog=Adventure Works DW Standard Edition 2008R2;Integrated Security=SSPI;Persist Security Info=False;"));32 }33 }34}

Full Screen

Full Screen

GetTarget

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.NUnit.Builder;7{8 {9 static void Main(string[] args)10 {11 string connectionString = "Data Source=(localdb)\v11.0;Initial Catalog=AdventureWorks2012;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";12 string catalog = "AdventureWorks2012";13 string schema = "Production";14 string table = "Product";15 string column = "Color";16 string target = "Blue";17 var request = new MetadataDiscoveryRequestBuilder();18 request.Setup(connectionString, catalog, schema, table, column, target);19 var result = request.GetTarget();20 Console.WriteLine(result);21 Console.ReadLine();22 }23 }24}

Full Screen

Full Screen

GetTarget

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.NUnit.Builder;7using NBi.Core.Calculation;8using NBi.Core.Query;9using NBi.Core.Query.Command;10using NBi.Core.Query.Resolver;11using NBi.Core.Query.Client;12using NBi.Core.Query.Execution;13using NBi.Core.Query.Reader;14using NBi.Core.Query.Reader.Csv;15using NBi.Core.Query.Reader.OleDb;16using NBi.Core.Query.Reader.SqlClient;17using NBi.Core.Query.Reader.Service;18using NBi.Core.Query.Reader.TextFile;19using NBi.Core.Query.Reader.Xml;20using NBi.Core.Query.Reader.Json;21using NBi.Core.Query.Reader.Projection;22using NBi.Core.Query.Reader.Csv;23using NBi.Core.Query.Reader.Csv.Multiline;24using NBi.Core.Query.Reader.Csv.Quote;25using NBi.Core.Query.Reader.Csv.Header;26using NBi.Core.Query.Reader.Csv.Delimiter;27using NBi.Core.Query.Reader.Csv.Escape;28using NBi.Core.Query.Reader.Csv.Encoding;29using NBi.Core.Query.Reader.Csv.Comment;30using NBi.Core.Query.Reader.Csv.Trimming;31using NBi.Core.Query.Reader.Csv.QuoteStyle;32using NBi.Core.Query.Reader.Csv.Format;33using NBi.Core.Query.Reader.Csv.SkipRows;34using NBi.Core.Query.Reader.Csv.SkipColumns;35using NBi.Core.Query.Reader.Csv.MaxRows;36using NBi.Core.Query.Reader.Csv.MaxColumns;37using NBi.Core.Query.Reader.Csv.NullValue;38using NBi.Core.Query.Reader.Csv.DataType;39using NBi.Core.Query.Reader.Csv.DateFormat;40using NBi.Core.Query.Reader.Csv.DateTimeStyles;41using NBi.Core.Query.Reader.Csv.TimeZone;42using NBi.Core.Query.Reader.Csv.NumberStyles;43using NBi.Core.Query.Reader.Csv.Culture;44using NBi.Core.Query.Reader.Csv.CultureName;45using NBi.Core.Query.Reader.Csv.CultureCode;46using NBi.Core.Query.Reader.Csv.CultureType;47using NBi.Core.Query.Reader.Csv.CultureLCID;48using NBi.Core.Query.Reader.Csv.CultureCompareInfo;49using NBi.Core.Query.Reader.Csv.CultureCalendar;50using NBi.Core.Query.Reader.Csv.CultureNumberFormat;51using NBi.Core.Query.Reader.Csv.CultureDateTimeFormat;52using NBi.Core.Query.Reader.Csv.CultureOptionalCalendars;

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using System;2using NBi.NUnit.Builder;3using NBi.NUnit.Execution;4using NBi.NUnit.Runtime.Configuration;5using NBi.Xml;6using NBi.Xml.Constraints;7using NBi.Xml.Items;8using NBi.Xml.Items.Calculation;9using NBi.Xml.Items.ResultSet;10using NBi.Xml.Systems;11using NBi.Xml.Systems.DataWarehouse;12using NUnit.Framework;13using NUnit.Framework.Interfaces;14using NUnit.Framework.Internal;15using NUnit.Framework.Internal.Builders;16using NUnit.Framework.Internal.Execution;17using NUnit.Framework.Internal.Filters;18using NUnit.Framework.Internal.WorkItems;19using NUnitLite;20using NUnitLite.Runner;21using NUnitLite.Runner.Services;22{23 {24 public void GetTarget_CatalogAndSchema_CatalogAndSchema()25 {26 var connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";27 var catalog = "AdventureWorks2012";28 var schema = "HumanResources";29 var xml = new MetadataDiscoveryRequestXml();30 xml.ConnectionString = new ConnectionStringXml(connectionString);31 xml.Catalog = catalog;32 xml.Schema = schema;33 var builder = new MetadataDiscoveryRequestBuilder(xml);34 var target = builder.GetTarget();35 Assert.That(target.Catalog, Is.EqualTo(catalog));36 Assert.That(target.Schema, Is.EqualTo(schema));37 }38 }39}40C# VB C++ F# public MetadataDiscoveryRequest GetTarget () Public Function GetTarget As MetadataDiscoveryRequest public : MetadataDiscoveryRequest ^ GetTarget () member GetTarget : unit -> MetadataDiscoveryRequest

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using NBi.Core;6using NBi.Core.Query;7using NBi.Core.Query.Command;8using NBi.Core.Query.Resolver;9using NBi.Core.Query.Resolver.CommandBuilder;10using NBi.Core.Query.Resolver.Csv;11using NBi.NUnit.Builder;12using NUnit.Framework;13{14 {15 static void Main(string[] args)16 {17 var connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorks2012;Integrated Security=True;";18 var request = new MetadataDiscoveryRequestBuilder()19 .Setup(new ConnectionStringSettings(connectionString, ConnectionStringType.Sql))20 .Setup(new CommandTextSettings("SELECT * FROM [Person].[Person]"))21 .GetTarget();22 var resolver = new QueryResolverFactory().Instantiate(request);23 var result = resolver.Execute();24 }25 }26}

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using NBi.Core;6using NBi.Core.Query;7using NBi.Core.Query.Command;8using NBi.Core.Query.Resolver;9using NBi.Core.Query.Resolver.CommandBuilder;10using NBi.Core.Query.Resolver.Csv;11using NBi.NUnit.Builder;12using NUnit.Framework;13{14 {15 static void Main(string[] args)16 {17 var connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorks2012;Integrated Security=True;";18 var request = new MetadataDiscoveryRequestBuilder()19 .Setup(new ConnectionStringSettings(connectionString, ConnectionStringType.Sql))20 .Setup(new CommandTextSettings("SELECT * FROM [Person].[Person]"))21 .GetTarget();22 var resolver = new QueryResolverFactory().Instantiate(request);23 var result = resolver.Execute();24 }25 }26}

Full Screen

Full Screen

GetTarget

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.NUnit.Builder;7using NBi.Core.Calculation;8using NBi.Core.Scalar.Resolver;9using NBi.Core.Sequence.Resolver;10using NBi.Core.Sequence;11using NBi.Core;12using NBi.Core.ResultSet;13using NBi.Core.ResultSet.Resolver;14using NBi.Core.Variable;15using NBi.Core.Variable.Resolver;16using NBi.Core.Analysis.Request;17using NBi.Core.Analysis.Member;18using NBi.Core.Analysis.Metadata;19using NBi.Core.Analysis.Metadata.Adomd;20using NBi.Core.Analysis.Metadata.Asa;21using NBi.Core.Analysis.Metadata.Request;22using NBi.Core.Analysis.Metadata.Response;23{24 {25 static void Main(string[] args)26 {27 var request = new Metasa;

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using NBi.NUnit.Builder;2using NBi.NUnit.Query;3using NBi.Xml;4using NBi.Xml.Constraints;5using NBi.Xml.Items;6using NBi.Xml.Systems;7using NBi.Xml.Settings;8using NBi.Core;9using NBi.Core.Query;10using NBi.Core.Query.Redolver;11using NBi.Core.Query.CommandtaDiscoveryRequest();12 re.QueryqClient;13using NBi.Core.Query.Command.Text;14using NBi.Core.Query.Execution;15using NBi.Core.ResultSet;16using NBi.Core.ResultSet.Resolver;17using NBi.Core.ResultSet.unalyzer;18using NBi.Core.ResultSet.Filtering;19usieg NBi.Core.ResultSet.Lookup;20using NBi.Core.ResultSet.Comparer;21using NBi.Core.ResultSet.Lookup.Violation;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.Quintile;29using NBi.Core.Calculation.Ranking.Quartile;30using NBi.Core.Calculation.Ranking.Decile;31using NBi.Core.Calculation.Ranking.Percentile;32using NBi.Core.Calculation.Ranking.Quintile;33using NBi.Core.Calculation.Ranking.Quartile;34using NBi.Core.Calculation.Ranking.Decile;35using NBi.Core.Calculation.Ranking.Percentile;36using NBi.Core.Calculation.Ranking.Quintile;37using NBi.Core.Calculation.Ranking.Quartile;38using NBi.Core.Calculation.Ranking.Decile;39using NBi.Core.Calculation.Ranking.Percentile;40using NBi.Core.Calculation.Ranking.Quintile;41using NBi.Core.Calculation.Ranking.Quartile;42using NBi.Core.Calculation.Ranking.Decile;43using NBi.Core.Calculation.Ranking.Percentile;44using NBi.Core.Calculation.Ranking.Quintile;45using NBi.Core.Calculation.Ranking.Quartile;46using NBi.Core.Calculation.Ranking.Decile;47using NBi.Core.Calculation.Ranking.Percentile;48using NBi.Core.Calculation.Ranking.Quintile;49using NBi.Core.Calculation.Ranking.Quartile;50using NBist.Target = new MetadataTarget();51 request.Target.Type = MetadataTargetType.Metadata;52 request.Target.Target = new MetadataTargetIdentifier();53 request.Target.Target.Type = MetadataTargetIdentifierType.Cube;54 request.Target.Target.Value = "Adventure Works";55 request.Target.Target.Catalog = "Adventure Works DW 2008R2";56 request.Target.Target.Server = "localhost";57 var builder = new MetadataDiscoveryRequestBuilder();58 var target = builder.GetTarget(request);59 Console.WriteLine(target);60 }61 }62}63using System;64using System.Collections.Generic;65using System.Linq;66using System.Text;67using System.Threading.Tasks;68using NBi.NUnit.Builder;69using NBi.Core.Calculation;70using NBi.Core.Scalar.Resolver;71using NBi.Core.Sequence.Resolver;72using NBi.Core.Sequence;73using NBi.Core;74using NBi.Core.ResultSet;75using NBi.Core.ResultSet.Resolver;76using NBi.Core.Variable;77using NBi.Core.Variable.Resolver;78using NBi.Core.Analysis.Request;79using NBi.Core.Analysis.Member;80using NBi.Core.Analysis.Metadata;81using NBi.Core.Analysis.Metadata.Adomd;82using NBi.Core.Analysis.Metadata.Asa;

Full Screen

Full Screen

GetTarget

Using AI Code Generation

copy

Full Screen

1using NBi.NUnit.Builder;2using NBi.NUnit.Query;3using NBi.Xml;4using NBi.Xml.Constraints;5using NBi.Xml.Items;6using NBi.Xml.Systems;7using NBi.Xml.Settings;8using NBi.Core;9using NBi.Core.Query;10using NBi.Core.Query.Resolver;11using NBi.Core.Query.Command;12using NBi.Core.Query.Client;13using NBi.Core.Query.Command.Text;14using NBi.Core.Query.Execution;15using NBi.Core.ResultSet;16using NBi.Core.ResultSet.Resolver;17using NBi.Core.ResultSet.Analyzer;18using NBi.Core.ResultSet.Filtering;19using NBi.Core.ResultSet.Lookup;20using NBi.Core.ResultSet.Comparer;21using NBi.Core.ResultSet.Lookup.Violation;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.Quintile;29using NBi.Core.Calculation.Ranking.Quartile;30using NBi.Core.Calculation.Ranking.Decile;31using NBi.Core.Calculation.Ranking.Percentile;32using NBi.Core.Calculation.Ranking.Quintile;33using NBi.Core.Calculation.Ranking.Quartile;34using NBi.Core.Calculation.Ranking.Decile;35using NBi.Core.Calculation.Ranking.Percentile;36using NBi.Core.Calculation.Ranking.Quintile;37using NBi.Core.Calculation.Ranking.Quartile;38using NBi.Core.Calculation.Ranking.Decile;39using NBi.Core.Calculation.Ranking.Percentile;40using NBi.Core.Calculation.Ranking.Quintile;41using NBi.Core.Calculation.Ranking.Quartile;42using NBi.Core.Calculation.Ranking.Decile;43using NBi.Core.Calculation.Ranking.Percentile;44using NBi.Core.Calculation.Ranking.Quintile;45using NBi.Core.Calculation.Ranking.Quartile;46using NBi.Core.Calculation.Ranking.Decile;47using NBi.Core.Calculation.Ranking.Percentile;48using NBi.Core.Calculation.Ranking.Quintile;49using NBi.Core.Calculation.Ranking.Quartile;

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.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful