Exemplo n.º 1
0
        public void SimplePop_Pop_Test()
        {
            //  Arrange
            var stack = new CheckedLayeredStack <string>();

            stack.Push("a");
            stack.Push("b");
            //  Act
            var b = stack.Pop();
            var a = stack.Pop();

            //  Assert
            Assert.True(stack.IsEmpty());
            Assert.Equal(0, stack.Size());
            Assert.Equal("b", b);
            Assert.Equal("a", a);
        }
Exemplo n.º 2
0
        public void CannotPopEmpty_Pop_Test()
        {
            //  Arrange
            var stack = new CheckedLayeredStack <string>();

            //  Assert
            Assert.Throws <NutmegException>(() => stack.Pop());
        }