Пример #1
0
        public void Grow_GivesCorrectNewSize()
        {
            var ms = new MaxStack <string>(10);

            ms.Grow(0.5f);
            Assert.AreEqual(15, ms.MaxSize);
        }
Пример #2
0
        public void Grow_AddSpaceAtEnd()
        {
            var ms = new MaxStack <int>(2);

            ms.Push(1);
            ms.Push(2);
            ms.Grow(0.5f);
            Assert.AreEqual(3, ms.MaxSize);
            Assert.AreEqual(2, ms.Pop());
            Assert.AreEqual(1, ms.Pop());
            Assert.AreEqual(0, ms.Peek());
        }