Example #1
0
        public void TestPushPops()
        {
            StackUp <string> stack = new StackUp <string>();

            stack.Push("Hello");
            stack.Push("Hi");
            stack.Push("Howdy");
            stack.Push("Bonjour");
            Assert.AreEqual(4, stack.Count);
            Assert.AreEqual("Bonjour", stack.Pop());
            Assert.AreEqual("Howdy", stack.Pop());
            Assert.AreEqual("Hi", stack.Pop());
            Assert.AreEqual("Hello", stack.Pop());
            Assert.AreEqual(0, stack.Count);
        }
Example #2
0
        public void TestPush()
        {
            StackUp <string> stack = new StackUp <string>();

            stack.Push("hello");
            Assert.AreEqual(1, stack.Count);
        }
Example #3
0
        public void TestGetCount()
        {
            StackUp <string> stack = new StackUp <string>();

            Assert.AreEqual(stack.Count, 0);
            stack.Push("get_Count");
            Assert.AreEqual(1, stack.Count);
        }
Example #4
0
        public void TestPeek()
        {
            StackUp <string> stack = new StackUp <string>();

            stack.Push("Peek");
            string s = stack.Peek();

            Assert.AreEqual("Peek", s);
        }