Exemplo n.º 1
0
        public void PushToStack_Expect_EqualPop()
        {
            int expected = 1;
            var stack    = new WsStack <int>(2);

            stack.Push(expected);
            var sut = stack.Pop();

            Assert.Equal(expected, sut);
        }
Exemplo n.º 2
0
        public void PushOverStack_Expect_Resize()
        {
            var stack = new WsStack <int>(1);

            stack.Push(1);
            stack.Push(2);
            stack.Push(3);
            var sut = stack.Pop();

            Assert.Equal(3, sut);
        }
Exemplo n.º 3
0
        public void PopEmptyStack_Expect_InvalidOperation()
        {
            var stack = new WsStack <int>(1);

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