Exemple #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);
        }
Exemple #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);
        }
Exemple #3
0
        public void PopEmptyStack_Expect_InvalidOperation()
        {
            var stack = new WsStack <int>(1);

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