private static FileNotMatchingMatcher GetLowerCaseWordFileMatcher()
        {
            Regex expression = new Regex("[a-z]+");

            LineMatcher lineMatcher = new LineMatcher(expression);

            FileNotMatchingMatcher matcher = new FileNotMatchingMatcher(lineMatcher);

            return matcher;
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public void TestNull()
        {
            Regex expression = new Regex("^[a-z]+$");

            LineMatcher matcher = new LineMatcher(expression);

            Assert.Throws<ArgumentNullException>(() => matcher.Match(null));
        }