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

            SOI.Clear();
            SOI.Push(1);
            SOI.AddAll();
            Assert.AreEqual(1, SOI.StackInt.Peek());
        }
示例#2
0
        public void TestaddAll()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Push(1);
            SOI.Push(11);
            SOI.Push(21);
            SOI.AddAll();
            Assert.AreEqual(21 + 11 + 1, SOI.StackInt.Peek());
        }
示例#3
0
        public void TestAddAllIsempty()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            try
            {
                SOI.AddAll();
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }