コード例 #1
0
        /// <summary>
        /// Selects the <see cref="IStatMatchers"/> instance best matching the given <see cref="ParsingStep"/>.
        /// </summary>
        public IStatMatchers Get(ParsingStep parsingStep)
        {
            var asString = parsingStep.GetName();

            return(_orderedCandidates.Value
                   .First(c => c.GetType().Name.StartsWith(asString, StringComparison.Ordinal)));
        }
コード例 #2
0
        public Type GetWithKnownReturnsCorrectResult(ParsingStep parsingStep)
        {
            var sut = CreateSut(new SpecialMatchers(), new ValueConversionMatchers(),
                                new FormAndStatMatchers(), new FormMatchers(), new FormZMatchers());

            var statMatchers = sut.Get(parsingStep);

            return(statMatchers.GetType());
        }
コード例 #3
0
        /// <summary>
        /// Selects the <see cref="IStatMatchers"/> instance best matching the given <see cref="ParsingStep"/>.
        /// </summary>
        public IStatMatchers Get(ParsingStep parsingStep)
        {
            var asString = parsingStep.ToString();

            return((
                       from c in _candidates
                       let name = c.GetType().Name
                                  where name.StartsWith(asString, StringComparison.Ordinal)
                                  orderby name.Length
                                  select c
                       ).First());
        }