Exemplo n.º 1
0
        public void TestingPushAndPopTogether()
        {
            var stack = new StackKata <int>();

            stack.Push(5);
            Assert.That(stack.Pop(), Is.EqualTo(5));
        }
Exemplo n.º 2
0
        public void PopShouldRemoveLastPush()
        {
            var stack = new StackKata <int>();

            stack.Push(7);
            stack.Push(9);
            stack.Push(1);
            Assert.That(stack.Pop(), Is.EqualTo(1));
            Assert.That(stack.Count, Is.EqualTo(2));
        }
Exemplo n.º 3
0
        public void PoppingAnEmptyStackShouldThrowInvalidOperationException()
        {
            var stack = new StackKata <int>();

            Assert.That(() => stack.Pop(), Throws.InvalidOperationException);
        }