/// <summary>
        /// Creates a pattern evaluator.
        /// </summary>
        /// <param name="testModelBuilder">The test model builder.</param>
        /// <param name="patternResolver">The pattern resolver.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="testModelBuilder"/> or
        /// <paramref name="patternResolver"/> is null.</exception>
        public DefaultPatternEvaluator(ITestModelBuilder testModelBuilder, IPatternResolver patternResolver)
        {
            if (testModelBuilder == null)
                throw new ArgumentNullException("testModelBuilder");
            if (patternResolver == null)
                throw new ArgumentNullException("patternResolver");

            this.testModelBuilder = testModelBuilder;
            this.patternResolver = patternResolver;

            registeredScopes = new MultiMap<ICodeElementInfo, IPatternScope>();

            var rootDataContextBuilder = new DefaultTestDataContextBuilder(testModelBuilder, new PatternTestDataContext(null));
            rootDataContextBuilder.DefineDataSource("");
            rootScope = new DefaultPatternScope(this, null, testModelBuilder.RootTestBuilder, null, rootDataContextBuilder, false);
        }
示例#2
0
        /// <summary>
        /// Creates a pattern evaluator.
        /// </summary>
        /// <param name="testModelBuilder">The test model builder.</param>
        /// <param name="patternResolver">The pattern resolver.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="testModelBuilder"/> or
        /// <paramref name="patternResolver"/> is null.</exception>
        public DefaultPatternEvaluator(ITestModelBuilder testModelBuilder, IPatternResolver patternResolver)
        {
            if (testModelBuilder == null)
            {
                throw new ArgumentNullException("testModelBuilder");
            }
            if (patternResolver == null)
            {
                throw new ArgumentNullException("patternResolver");
            }

            this.testModelBuilder = testModelBuilder;
            this.patternResolver  = patternResolver;

            registeredScopes = new MultiMap <ICodeElementInfo, IPatternScope>();

            var rootDataContextBuilder = new DefaultTestDataContextBuilder(testModelBuilder, new PatternTestDataContext(null));

            rootDataContextBuilder.DefineDataSource("");
            rootScope = new DefaultPatternScope(this, null, testModelBuilder.RootTestBuilder, null, rootDataContextBuilder, false);
        }