public void GetMatchesFindsNoMatchesForEmpty()
        {
            NegativeLookAheadExpression<char> expression = new NegativeLookAheadExpression<char> (m_any);

             var matches = expression.GetMatches (EmptyList, 0).ToList ();

             Assert.AreEqual (1, matches.Count, "matches.Count");
             Assert.AreEqual (0, matches[0].Index, "matches[0].Index");
             Assert.AreEqual (0, matches[0].Length, "matches[0].Length");
        }
        public void GetMatchesFindsOneMatchForB()
        {
            NegativeLookAheadExpression<char> expression = new NegativeLookAheadExpression<char> (m_B);

             string [] expectedValues = new [] {"",""};
             int index = 0;
             var list = AList;
             var matches = expression.GetMatches (list, index).ToList ();

             Assert.AreEqual (expectedValues.Length, matches.Count (), "Count");

             for (int i = 0; i < expectedValues.Length; i++)
             {
            var match = matches [i];
            var expected = expectedValues [i];
            Assert.AreEqual (index, match.Index, "match.Index");
            Assert.AreEqual (expected.Length, match.Length, "match.Length");
            Assert.IsTrue (match.Success, "match.Success");
            Assert.AreEqual (expected.Length, match.Items.Count, "match.Items.Count");
            Assert.AreEqual (expected, new string (match.Items.ToArray ()), "match.Items");
            index++;
             }
        }
 public void ConstructorSucceeds()
 {
     var expression = new NegativeLookAheadExpression<char> (m_A);
      Assert.IsTrue (expression.Negate);
 }
 public void ConstructorThrowArgumentNullExceptionForNullArray()
 {
     var expression = new NegativeLookAheadExpression<char> ((IExpression<char>) null);
 }
        public void IsMatchAt9Of_NegativeLookAhead_Greedy_Any_2_ForDigetsReturnsTrue()
        {
            int index = 9;
             NegativeLookAheadExpression<char> expression = new NegativeLookAheadExpression<char> (new GreedyRepeatExpression<char> (m_any, 2));
             int length = 0;

             var list = DigetsList;
             var ml = expression.IsMatchAt (list, index);
             Assert.IsTrue (ml.Success, "isMatch");
             Assert.AreEqual (length, ml.Length, "assertionLength");
        }