Exemplo n.º 1
0
        public void StackCanPushElements()
        {
            var stack = new GenericStackFromLinkedListImplementation <string>(new Node <string>("home"));

            stack.Push("neighbor");
            stack.Push("lovely");

            Assert.Equal(3, stack.Count);
        }
Exemplo n.º 2
0
        public void StackPopsOffTheCorrectElement()
        {
            var stack = new GenericStackFromLinkedListImplementation <string>(new Node <string>("home"));

            stack.Push("name");
            stack.Push("email");

            var popped = stack.Pop.Value;

            Assert.Equal("email", popped);
        }
Exemplo n.º 3
0
        public void StackCanPeekInToSeeNextElement()
        {
            var stack = new GenericStackFromLinkedListImplementation <string>(new Node <string>("home"));

            stack.Push("added");

            Assert.Equal("added", stack.Peek.Value);
        }