public string?TryGetMatcherDataOutputsCorrectMatcherData(string referenceName, int matcherIndex) { var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList); sut.TryGetMatcherData(referenceName, matcherIndex, out var matcherData); return(matcherData?.Regex); }
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)); }
public bool TryGetMatcherDataReturnsCorrectResult(string referenceName, int matcherIndex) { var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList); return(sut.TryGetMatcherData(referenceName, matcherIndex, out var _)); }
public void GetReferencesReturnsEmptyEnumerableIfReferenceNameIsUnknown(string referenceName) { var sut = new ReferenceService(DefaultReferencedMatchersList, DefaultStatMatchersList); CollectionAssert.IsEmpty(sut.GetRegexes(referenceName)); }