public List <Assertion> MatchVerifications(List <Assertion> verifications, string httpContent) { var matchedItems = new List <Assertion>(); foreach (Assertion item in verifications) { var assertionLogger = new AssertionLogger(_logger); assertionLogger.LogItem(item.AssertionType, item); switch (item.AssertionMethod) { case AssertionMethod.CssSelector: var cqMatcher = new AngleSharpMatcher(_variableProvider, assertionLogger); cqMatcher.Match(item, httpContent); break; case AssertionMethod.Regex: default: var regexMatcher = new RegexMatcher(_variableProvider, assertionLogger); regexMatcher.Match(item, httpContent); break; } item.Log = assertionLogger.GetLog(); matchedItems.Add(item); } return(matchedItems); }
public RegexMatcher(ICapturedVariableProvider variableProvider, AssertionLogger assertionLogger) { _variableProvider = variableProvider; _assertionLogger = assertionLogger; }
public AngleSharpMatcher(ICapturedVariableProvider variableProvider, AssertionLogger assertionLogger) { _variableProvider = variableProvider; _assertionLogger = assertionLogger; }