Esempio n. 1
0
        public void TestAddAllNumber1Number()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            SOI.Push(1);
            SOI.AddAll();
            Assert.AreEqual(1, SOI.StackInt.Peek());
        }
Esempio n. 2
0
        public void TestMultiplyAll1Number()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            SOI.Push(1);
            SOI.MultiAllNumbers();
            Assert.AreEqual(1, SOI.StackInt.Peek());
        }
Esempio n. 3
0
        public void TestClear()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Push(1);
            SOI.Push(11);
            SOI.Push(21);
            SOI.Clear();
            Assert.AreEqual(0, SOI.StackInt.Count());
        }
Esempio n. 4
0
        public void TestAddAllIsempty()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            try
            {
                SOI.AddAll();
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }
Esempio n. 5
0
        public void TestMultiplyAllIsempty()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            try
            {
                SOI.MultiAllNumbers();
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }
Esempio n. 6
0
        public void TestAddTwoException()
        {
            StackOfInt SOI = new StackOfInt();

            SOI.Clear();
            SOI.Push(2);
            try
            {
                SOI.AddTop2();
                Assert.Fail();
            }
            catch (System.Exception)
            {
            }
        }