public void TrimExcess_Test_Method(int elements)
        {
            var g = new StosWTablicy <int>(elements);

            for (int i = 0; i < elements; ++i)
            {
                g.Push(i);
            }
            g.TrimExcess();
            Assert.AreEqual(elements, (int)Math.Floor(g.GetTabLength() * 0.9));
        }
示例#2
0
        public void TrimExcessDlaPustegoStosu_Valid(int size)
        {
            var s = new StosWTablicy <int>(size);

            for (int i = 0; i < size; ++i)
            {
                s.Push(i);
            }
            s.TrimExcess();
            Assert.AreEqual(size, (int)Math.Floor(s.GetTabLength() * 0.9));
        }