private static FileNotMatchingMatcher GetLowerCaseWordFileMatcher() { Regex expression = new Regex("[a-z]+"); LineMatcher lineMatcher = new LineMatcher(expression); FileNotMatchingMatcher matcher = new FileNotMatchingMatcher(lineMatcher); return matcher; }
public void TestEmpty() { Regex expression = new Regex("^[a-z]+$"); string line = string.Empty; LineMatcher matcher = new LineMatcher(expression); IList<ColumnMatch> results = matcher.Match(line).ToList(); Assert.AreEqual(0, results.Count()); }
public void TestDoesNotMatchLine() { Regex expression = new Regex("^[a-z]+$"); const string line = "abc1"; LineMatcher matcher = new LineMatcher(expression); IList<ColumnMatch> results = matcher.Match(line).ToList(); Assert.AreEqual(0, results.Count()); }
public void TestMatchesEntireLine() { Regex expression = new Regex("^[a-z]+$"); const string line = "abc"; LineMatcher matcher = new LineMatcher(expression); IList<ColumnMatch> results = matcher.Match(line).ToList(); Assert.AreEqual(1, results.Count()); Assert.AreEqual(0, results[0].Column); Assert.AreEqual(3, results[0].Length); }
public void TestNull() { Regex expression = new Regex("^[a-z]+$"); LineMatcher matcher = new LineMatcher(expression); Assert.Throws<ArgumentNullException>(() => matcher.Match(null)); }