public virtual MembersDiscoveryRequest Build(string connectionString, IEnumerable <string> excludedMembers, IEnumerable <PatternValue> excludedPatterns, string perspective, string set) { Validate( new List <Validation>() { new ConnectionStringNotEmpty(connectionString) } ); //If validation of parameters is successfull then we build the object var disco = new MembersDiscoveryRequest(); disco.ConnectionString = connectionString; if (!string.IsNullOrEmpty(perspective)) { disco.SpecifyFilter(new CaptionFilter(perspective, DiscoveryTarget.Perspectives)); } if (!string.IsNullOrEmpty(set)) { disco.SpecifyFilter(new CaptionFilter(set, DiscoveryTarget.Sets)); } disco.Function = string.Empty; disco.MemberCaption = string.Empty; disco.ExcludedMembers = excludedMembers; disco.ExcludedPatterns = excludedPatterns; return(disco); }
public virtual MembersDiscoveryRequest Build(string connectionString, string memberCaption , IEnumerable<string> excludedMembers, IEnumerable<PatternValue> excludedPatterns, string perspective, string dimension, string hierarchy, string level) { //Validations Validate( new List<Validation>() { new ConnectionStringNotEmpty(connectionString), //new PerspectiveNotNull(perspective), //new DimensionNotNullIfHierarchy(dimension), //!string.IsNullOrEmpty(level) ? (Validation)new HierarchyNotNullIfLevel(hierarchy) : new NoValidation() } ); //If validation of parameters is successfull then we build the object var disco = new MembersDiscoveryRequest(); disco.ConnectionString = connectionString; if (!string.IsNullOrEmpty(perspective)) disco.SpecifyFilter(new CaptionFilter(perspective, DiscoveryTarget.Perspectives)); if (!string.IsNullOrEmpty(dimension)) disco.SpecifyFilter(new CaptionFilter(dimension, DiscoveryTarget.Dimensions)); if (!string.IsNullOrEmpty(hierarchy)) disco.SpecifyFilter(new CaptionFilter(hierarchy, DiscoveryTarget.Hierarchies)); if (!string.IsNullOrEmpty(level)) disco.SpecifyFilter(new CaptionFilter(level, DiscoveryTarget.Levels)); disco.Function = string.IsNullOrEmpty(memberCaption) ? "members" : "children"; disco.MemberCaption = memberCaption; disco.ExcludedMembers = excludedMembers; disco.ExcludedPatterns = excludedPatterns; return disco; }
public virtual MembersDiscoveryRequest Build(string connectionString, string memberCaption , IEnumerable <string> excludedMembers, IEnumerable <PatternValue> excludedPatterns, string perspective, string dimension, string hierarchy, string level) { //Validations Validate( new List <Validation>() { new ConnectionStringNotEmpty(connectionString), //new PerspectiveNotNull(perspective), //new DimensionNotNullIfHierarchy(dimension), //!string.IsNullOrEmpty(level) ? (Validation)new HierarchyNotNullIfLevel(hierarchy) : new NoValidation() } ); //If validation of parameters is successfull then we build the object var disco = new MembersDiscoveryRequest(); disco.ConnectionString = connectionString; if (!string.IsNullOrEmpty(perspective)) { disco.SpecifyFilter(new CaptionFilter(perspective, DiscoveryTarget.Perspectives)); } if (!string.IsNullOrEmpty(dimension)) { disco.SpecifyFilter(new CaptionFilter(dimension, DiscoveryTarget.Dimensions)); } if (!string.IsNullOrEmpty(hierarchy)) { disco.SpecifyFilter(new CaptionFilter(hierarchy, DiscoveryTarget.Hierarchies)); } if (!string.IsNullOrEmpty(level)) { disco.SpecifyFilter(new CaptionFilter(level, DiscoveryTarget.Levels)); } disco.Function = string.IsNullOrEmpty(memberCaption) ? "members" : "children"; disco.MemberCaption = memberCaption; disco.ExcludedMembers = excludedMembers; disco.ExcludedPatterns = excludedPatterns; return(disco); }
public virtual MembersDiscoveryRequest Build(string connectionString, IEnumerable<string> excludedMembers, IEnumerable<PatternValue> excludedPatterns, string perspective, string set) { Validate( new List<Validation>() { new ConnectionStringNotEmpty(connectionString) } ); //If validation of parameters is successfull then we build the object var disco = new MembersDiscoveryRequest(); disco.ConnectionString = connectionString; if (!string.IsNullOrEmpty(perspective)) disco.SpecifyFilter(new CaptionFilter(perspective, DiscoveryTarget.Perspectives)); if (!string.IsNullOrEmpty(set)) disco.SpecifyFilter(new CaptionFilter(set, DiscoveryTarget.Sets)); disco.Function = string.Empty; disco.MemberCaption = string.Empty; disco.ExcludedMembers = excludedMembers; disco.ExcludedPatterns = excludedPatterns; return disco; }
protected bool Process(MembersDiscoveryRequest actual) { Request = actual; var engine = MembersEngine; MemberResult result = engine.GetMembers(Request); return this.Matches(result); }
/// <summary> /// Construct a AbstractMembersConstraint /// </summary> /// <param name="expected">The request to discover members in a hierarchy or level</param> public AbstractMembersCollectionConstraint(MembersDiscoveryRequest expected) : base() { membersDiscoveryRequest = expected; }
protected IEnumerable<string> GetMembersFromDiscoveryRequest(MembersDiscoveryRequest disco) { var engine = new MembersAdomdEngine(); var results = engine.GetMembers(disco); var members = results.ToCaptions(); return members; }
public virtual MemberResult GetMembers(MembersDiscoveryRequest command) { var cmd = new MembersCommand(command.ConnectionString, command.Function, command.MemberCaption, command.ExcludedMembers, command.ExcludedPatterns); var filters = command.GetAllFilters(); return cmd.List(filters); }
/// <summary> /// Construct a EquivalentToConstraint /// </summary> /// <param name="expected">The request to discover members in a hierarchy or level</param> public EquivalentToConstraint(MembersDiscoveryRequest expected) : base(expected) { }
/// <summary> /// Construct a ContainConstraint /// </summary> /// <param name="expected">The request to discover members in a hierarchy or level</param> public ContainConstraint(MembersDiscoveryRequest expected) : base(expected) { }
/// <summary> /// Construct a SubsetOfConstraint /// </summary> /// <param name="expected">The request to discover members in a hierarchy or level</param> public SubsetOfConstraint(MembersDiscoveryRequest expected) : base(expected) { }