コード例 #1
0
 public void ItEnumeratesAfterLookAhead(string @in, int lookTo)
 {
     var lookAhead = new LookAheadStream<char>(@in);
     lookAhead.LookAhead(lookTo);
     var enumeratedLookAhead = lookAhead.ToArray();
     Assert.That(enumeratedLookAhead.SequenceEqual(@in));
 }
コード例 #2
0
        public void ItEnumeratesAfterLookAhead(string @in, int lookTo)
        {
            var lookAhead = new LookAheadStream <char>(@in);

            lookAhead.LookAhead(lookTo);
            var enumeratedLookAhead = lookAhead.ToArray();

            Assert.That(enumeratedLookAhead.SequenceEqual(@in));
        }
コード例 #3
0
 public void ATotallyCrazyLookAheadDoesNotHurtTraversal(string @in)
 {
     var rand = new Random();
     var lookAhead = new LookAheadStream<char>(@in);
     foreach (char t in @in)
     {
         lookAhead.LookAhead(rand.Next(10));
         Assert.IsTrue(lookAhead.MoveNext());
         Assert.AreEqual(t, lookAhead.Current);
     }
 }
コード例 #4
0
        public void ATotallyCrazyLookAheadDoesNotHurtTraversal(string @in)
        {
            var rand      = new Random();
            var lookAhead = new LookAheadStream <char>(@in);

            foreach (char t in @in)
            {
                lookAhead.LookAhead(rand.Next(10));
                Assert.IsTrue(lookAhead.MoveNext());
                Assert.AreEqual(t, lookAhead.Current);
            }
        }