/// <summary> /// Gets a list of all statement rules with settings for the specified project /// </summary> /// <param name="configFactory">The configuration factory to use</param> /// <returns>The rules</returns> public IEnumerable <StatementRuleBase> GetStatementRules(ICalidusRuleConfigurationFactory configFactory) { IList <StatementRuleBase> statementRules = new List <StatementRuleBase>(); foreach (IStatementRuleFactory aFactory in _statementRuleProvider.GetStatementRuleFactories()) { foreach (StatementRuleBase aStatementRule in aFactory.GetStatementRules(configFactory)) { statementRules.Add(aStatementRule); } } return(statementRules); }
public void GetStatementRulesShouldCallStatementRuleFactoryProvider() { IStatementRuleFactoryProvider ruleFactoryProvider = Mocker.StrictMock <IStatementRuleFactoryProvider>(); IBlockRuleFactoryProvider blockRuleFactoryProvider = Mocker.StrictMock <IBlockRuleFactoryProvider>(); ILineRuleFactoryProvider lineRuleFactoryProvider = Mocker.StrictMock <ILineRuleFactoryProvider>(); ICalidusRuleConfigurationFactory configFactory = Mocker.DynamicMock <ICalidusRuleConfigurationFactory>(); Expect.Call(ruleFactoryProvider.GetStatementRuleFactories()).Return(new List <IStatementRuleFactory>()).Repeat.Once(); Mocker.ReplayAll(); CalidusRuleProvider provider = new CalidusRuleProvider(ruleFactoryProvider, blockRuleFactoryProvider, lineRuleFactoryProvider); provider.GetStatementRules(configFactory); Mocker.VerifyAll(); }