Exemplo n.º 1
0
        public void EC_Contains()
        {
            ArrayBasedStack <int> stack = new ArrayBasedStack <int> (2);

            stack.Push(1);
            stack.Push(2);
            Assert.IsTrue(stack.Contains(1));
            Assert.IsFalse(stack.Contains(5));
        }
        public static void ContainsTest()
        {
            var stack = new ArrayBasedStack <int>(new[] { 0, 1, 2, 3, 4 });

            Assert.IsTrue(stack.Contains(0));
            Assert.IsTrue(stack.Contains(1));
            Assert.IsTrue(stack.Contains(2));
            Assert.IsTrue(stack.Contains(3));
            Assert.IsTrue(stack.Contains(4));
        }
Exemplo n.º 3
0
        public static void ContainsTest()
        {
            var stack = new ArrayBasedStack <int>(new[] { 0, 1, 2, 3, 4 });

            Assert.Multiple(() =>
            {
                stack.Contains(0).Should().BeTrue();
                stack.Contains(1).Should().BeTrue();
                stack.Contains(2).Should().BeTrue();
                stack.Contains(3).Should().BeTrue();
                stack.Contains(4).Should().BeTrue();
            });
        }
Exemplo n.º 4
0
        public void BCC_6()
        {
            ArrayBasedStack <int> stack = new ArrayBasedStack <int> (4);

            Assert.AreEqual(0, stack.Count);
            stack.Push(1);
            Assert.IsTrue(stack.Contains(1));
            Assert.AreNotEqual(stack.Count, stack.Capacity);
        }
Exemplo n.º 5
0
        public void BCC_13()
        {
            ArrayBasedStack <int> stack = new ArrayBasedStack <int> (4);

            stack.Push(1);
            stack.Push(2);
            stack.Push(3);
            Assert.AreEqual(3, stack.Count);
            Assert.IsFalse(stack.Contains(-2));
            Assert.AreNotEqual(stack.Count, stack.Capacity);
        }