Example #1
0
        /// <summary>
        /// Gets a list of all line rules with settings for the specified project
        /// </summary>
        /// <param name="configFactory">The configuration factory to use</param>
        /// <returns>The rules</returns>
        public IEnumerable <LineRuleBase> GetLineRules(ICalidusRuleConfigurationFactory configFactory)
        {
            List <LineRuleBase> lineRules = new List <LineRuleBase>();

            foreach (ILineRuleFactory aFactory in _lineRuleProvider.GetLineRuleFactories())
            {
                foreach (LineRuleBase aLineRule in aFactory.GetLineRules(configFactory))
                {
                    lineRules.Add(aLineRule);
                }
            }

            return(lineRules);
        }
Example #2
0
        public void GetLineRulesShouldCallLineRuleFactoryProvider()
        {
            IStatementRuleFactoryProvider    ruleFactoryProvider      = Mocker.StrictMock <IStatementRuleFactoryProvider>();
            IBlockRuleFactoryProvider        blockRuleFactoryProvider = Mocker.StrictMock <IBlockRuleFactoryProvider>();
            ILineRuleFactoryProvider         lineRuleFactoryProvider  = Mocker.StrictMock <ILineRuleFactoryProvider>();
            ICalidusRuleConfigurationFactory configFactory            = Mocker.DynamicMock <ICalidusRuleConfigurationFactory>();

            Expect.Call(lineRuleFactoryProvider.GetLineRuleFactories()).Return(new List <ILineRuleFactory>()).Repeat.Once();

            Mocker.ReplayAll();

            CalidusRuleProvider provider = new CalidusRuleProvider(ruleFactoryProvider, blockRuleFactoryProvider, lineRuleFactoryProvider);

            provider.GetLineRules(configFactory);

            Mocker.VerifyAll();
        }