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)); }
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)); }
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); } }
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); } }