示例#1
0
        public void Stack_Is_Empty()
        {
            var stack = new StackMin();

            var isEmpty = stack.IsEmpty();

            Assert.True(isEmpty);
            Assert.Equal(0, stack.Length);
            Assert.Null(stack.Top);
            Assert.Null(stack.Bottom);
            Assert.Equal(int.MaxValue, stack.Min());
        }
示例#2
0
        public void Stack_Is_Not_Empty()
        {
            var stack = new StackMin();

            stack.Push(10);
            var isEmpty = stack.IsEmpty();

            Assert.False(isEmpty);
            Assert.Equal(1, stack.Length);
            Assert.NotNull(stack.Top);
            Assert.NotNull(stack.Bottom);
            Assert.Equal(10, stack.Min());
        }