public void Setup()
 {
     this._unsubscriber        = A.Fake <IUnsubscriberFactory <IUniverseEvent> >();
     this._filteredRule        = A.Fake <IUniverseRule>();
     this._highMarketCapFilter = A.Fake <IHighMarketCapFilter>();
     this._observer            = A.Fake <IUniverseCloneableRule>();
     this._logger = A.Fake <ILogger <UniverseFilterService> >();
 }
 public IOrganisationalFactorBrokerService Build(
     IUniverseCloneableRule cloneableRule,
     IReadOnlyCollection <ClientOrganisationalFactors> factors,
     bool aggregateNonFactorableIntoOwnCategory)
 {
     return(new OrganisationalFactorBrokerService(
                cloneableRule,
                factors,
                aggregateNonFactorableIntoOwnCategory,
                this._logger));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="OrganisationalFactorBrokerService"/> class.
        /// </summary>
        /// <param name="cloneSource">
        /// The clone source.
        /// </param>
        /// <param name="factors">
        /// The factors.
        /// </param>
        /// <param name="aggregateNonFactorableIntoOwnCategory">
        /// The aggregate non factorable into own category.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        public OrganisationalFactorBrokerService(
            IUniverseCloneableRule cloneSource,
            IReadOnlyCollection <ClientOrganisationalFactors> factors,
            bool aggregateNonFactorableIntoOwnCategory,
            ILogger <OrganisationalFactorBrokerService> logger)
        {
            this.cloneSource = cloneSource ?? throw new ArgumentNullException(nameof(cloneSource));
            this.noneFactor  = this.cloneSource.Clone(new FactorValue(ClientOrganisationalFactors.None, string.Empty));
            this.factors     = this.FactorGuard(factors);

            this.aggregateNonFactorableIntoOwnCategory = aggregateNonFactorableIntoOwnCategory;

            this.traderFactors           = new Dictionary <string, IUniverseRule>();
            this.portfolioManagerFactors = new Dictionary <string, IUniverseRule>();
            this.fundFactors             = new Dictionary <string, IUniverseRule>();
            this.strategyFactors         = new Dictionary <string, IUniverseRule>();

            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }