示例#1
0
        public string?TryGetMatcherDataOutputsCorrectMatcherData(string referenceName, int matcherIndex)
        {
            var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList);

            sut.TryGetMatcherData(referenceName, matcherIndex, out var matcherData);
            return(matcherData?.Regex);
        }
示例#2
0
        public void GetReferencesReturnsCorrectResultForStatMatchersName(string referenceName)
        {
            var sut      = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList);
            var expected = DefaultStatMatchersList
                           .Where(r => r.ReferenceNames.Contains(referenceName))
                           .SelectMany(r => r.Data.Select(d => d.Regex));

            CollectionAssert.AreEqual(expected, sut.GetRegexes(referenceName));
        }
示例#3
0
        public bool TryGetMatcherDataReturnsCorrectResult(string referenceName, int matcherIndex)
        {
            var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList);

            return(sut.TryGetMatcherData(referenceName, matcherIndex, out var _));
        }
示例#4
0
        public void GetReferencesReturnsEmptyEnumerableIfReferenceNameIsUnknown(string referenceName)
        {
            var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList);

            CollectionAssert.IsEmpty(sut.GetRegexes(referenceName));
        }