示例#1
0
        public void Contains_givesCorrectResult()
        {
            var ms = new MaxStack <string>(2);

            ms.Push("1");
            ms.Push("2");
            ms.Push("3");
            Assert.IsTrue(ms.Contains("3"));
            Assert.IsTrue(ms.Contains("2"));
            Assert.IsFalse(ms.Contains("1"));
        }
示例#2
0
        public void Clear_removeAll()
        {
            var ms = new MaxStack <string>(3);

            ms.Push("1");
            ms.Push("2");
            ms.Push("3");
            ms.Clear();
            Assert.IsFalse(ms.Contains("3"));
            Assert.IsFalse(ms.Contains("2"));
            Assert.IsFalse(ms.Contains("1"));
            Assert.AreEqual(3, ms.MaxSize);
        }