Ejemplo n.º 1
0
        public void StackTrimExcess(int index)
        {
            int expectedLength;

            if (index <= 5)
            {
                expectedLength = index + 1;
            }
            else
            {
                expectedLength = index + Convert.ToInt32((1d / 10d) * index);
            }
            var s = new StosWTablicy <int>();

            for (int i = 0; i < index; i++)
            {
                s.Push(1);
            }
            s.TrimExcess();
            Assert.AreEqual(expectedLength, s.Length());
        }