public void LookupTest() { const string data = "How now, brown cow?"; var list = data.Split().Aggregate(BinaryRandomAccessList <string> .Empty, (current, word) => BinaryRandomAccessList <string> .Cons(word, current)); Assert.AreEqual("now,", BinaryRandomAccessList <string> .Lookup(2, list)); }
public void RoseTest() { const string data = "What's in a name? That which we call a rose by any other name would smell as sweet."; var list = data.Split().Aggregate(BinaryRandomAccessList <string> .Empty, (current, word) => BinaryRandomAccessList <string> .Cons(word, current)); Assert.AreEqual("sweet.", BinaryRandomAccessList <string> .Lookup(0, list)); Assert.AreEqual("What's", BinaryRandomAccessList <string> .Lookup(17, list)); }