示例#1
0
        public void TestsubTop2()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Push(1);
            SOI.Push(11);
            SOI.Push(21);
            SOI.SubTop2();
            Assert.AreEqual(21 - 11, SOI.StackInt.Peek());
        }
示例#2
0
        public void TestsubTop2Exception()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Push(1);
            try
            {
                SOI.SubTop2();
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }