Exemplo n.º 1
0
        public void StackPushTest()
        {
            var expected = new string[] { "my", "life", "is", "good" };

            Stack_ <string> result = new Stack_ <string>(4);

            foreach (string item in expected)
            {
                result.push(item);
            }

            Assert.IsTrue(expected.SequenceEqual(result.GetAllStackElements()));
        }
Exemplo n.º 2
0
        public void StackPeepTest()
        {
            var array = new string[] { "my", "life", "is", "good" };

            Stack_ <string> result = new Stack_ <string>(4);

            foreach (string item in array)
            {
                result.push(item);
            }

            string res      = result.peep(2);
            string expected = "is";

            Assert.AreEqual(expected, res);
        }