示例#1
0
        public void Get_Last_Element()
        {
            var stack = new MyStack <int>(3);

            stack.Add(1);
            stack.Add(2);

            int lastValue = stack.GetLastElement();

            Assert.AreEqual(2, lastValue);
        }
示例#2
0
        public void Get_Last_Element_Exception()
        {
            var mystack = new MyStack <int>(3);

            Assert.Throws <CustomException>(() => mystack.GetLastElement());
        }