public void ConstructsEmpty() { var expected = OkasakiList.Olist <int> .Empty; var actual = OkasakiList.empty <int>(); Assert.AreEqual(expected, actual); }
public void HeadReturnsNullOnEmptyList() { int?expected = null; var emptyList = OkasakiList.empty <int>(); var actual = OkasakiList.head <int>(emptyList); Assert.AreEqual(expected, actual); }
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); }