public void HeadTest() { const string data = "How now, brown cow?"; var list = data.Split().Aggregate(BinaryRandomAccessList <string> .Empty, (current, word) => BinaryRandomAccessList <string> .Cons(word, current)); Assert.AreEqual("cow?", BinaryRandomAccessList <string> .Head(list)); list = BinaryRandomAccessList <string> .Update(0, "dog?", list); Assert.AreEqual("dog?", BinaryRandomAccessList <string> .Head(list)); }
public void EmptyHeadTest() { var list = BinaryRandomAccessList <string> .Empty; AssertThrows <ArgumentNullException>(() => BinaryRandomAccessList <string> .Head(list)); }