public void HeadTest() { var stack = CustomStack <string> .Cons("Hello", CustomStack <string> .Empty); var head = CustomStack <string> .Head(stack); Assert.AreEqual("Hello", head); }
public void TailTest() { var empty = CustomStack <string> .Empty; var hello = CustomStack <string> .Cons("Hello", empty); var world = CustomStack <string> .Cons("World", hello); var stack = CustomStack <string> .Tail(world); Assert.AreEqual(hello, stack); }
public void NotEmptyTest() { var stack = CustomStack <string> .Cons("Hello", CustomStack <string> .Empty); Assert.IsFalse(CustomStack <string> .IsEmpty(stack)); }