public void ConConsOntoAnEmptyList()
        {
            var value    = "hello";
            var expected = OkasakiList.Olist <string> .NewValue(value, OkasakiList.Olist <string> .Empty);

            var actual = OkasakiList.cons(value, OkasakiList.empty <string>());

            Assert.AreEqual(expected, actual);
        }
        public void ConsConsOntoANonEmptyList()
        {
            var value1   = "hello";
            var value2   = "world";
            var tailNode = OkasakiList.singleton <string>(value2);

            var expected = OkasakiList.Olist <string> .NewValue(value1, tailNode);

            var actual = OkasakiList.cons(value1, tailNode);

            Assert.AreEqual(expected, actual);
        }
        public void HeadReturnsCorrectValueForList()
        {
            var value1 = 1;
            var value2 = 2;
            var value3 = 3;

            //we load up the list in reverse order, since basic cons inserts at the head
            var olist1 = OkasakiList.singleton(value3);
            var olist2 = OkasakiList.cons(value2, olist1);
            var olist3 = OkasakiList.cons(value1, olist2);

            var expected = value1;
            var actual   = OkasakiList.head(olist3);

            Assert.AreEqual(expected, actual);
        }