Exemple #1
0
        public void PopAndCount()
        {
            var stack = new stackv2.Stack <int>();

            stack.Push(2);
            stack.Push(4);
            stack.Push(8);
            Assert.AreEqual(3, stack.Count());
            Assert.AreEqual(8, stack.Pop());
            Assert.AreEqual(2, stack.Count());
            Assert.AreEqual(4, stack.Pop());
            Assert.AreEqual(1, stack.Count());
        }
Exemple #2
0
        public void PushUndCount()
        {
            var stack = new stackv2.Stack <int>();

            stack.Push(10);
            var result = stack.Count();

            Assert.AreEqual(1, result);
        }
Exemple #3
0
        public void PushTwoEntries()
        {
            var stack = new stackv2.Stack <bool>();

            stack.Push(true);
            stack.Push(false);
            var result = stack.Count();

            Assert.AreEqual(2, result);
        }