예제 #1
0
        public void If_the_stack_is_not_epty_the_cout_return_nonzero()
        {
            var stack = new LajtiStack();

            stack.Push(1);
            Assert.That(stack.Count, Is.EqualTo(1));
            stack.Push(2);
            Assert.That(stack.Count, Is.EqualTo(2));
        }
예제 #2
0
        public void When_put_two_items_to_the_stack_then_cout()
        {
            var stack = new LajtiStack();

            stack.Push(123);
            stack.Push(456);
            var result = stack.Pop();

            Assert.That(result, Is.EqualTo(456));
        }
예제 #3
0
        public void if_pop_the_last_elemet_of_stack_the_stack_does_not_contain_it_anymore()
        {
            var stack = new LajtiStack();

            stack.Push(456);
            stack.Push(999);
            var result1 = stack.Pop();
            var result2 = stack.Pop();

            Assert.That(result2, Is.EqualTo(456));
        }
예제 #4
0
        public void if_peak_the_last_elemet_of_stack_the_stack_still_contain_it()
        {
            var stack = new LajtiStack();

            stack.Push(456);
            stack.Push(999);
            var result1 = stack.Peek();
            var result2 = stack.Peek();

            Assert.That(result1, Is.EqualTo(999));
            Assert.That(result2, Is.EqualTo(999));
        }
예제 #5
0
        public void whent_the_stack_notepty_the_IsEmpty_is_false()
        {
            var stack = new LajtiStack();

            stack.Push(456);
            Assert.That(stack.IsEmpty, Is.False);
        }
예제 #6
0
        public void WhenAnItemIsAddedToTheStackThenTheNumberOfItemsIsOneAndtheStackIsNotEmptyAnyMore()
        {
            var stack = new LajtiStack();

            stack.Push(123);
            Assert.That(stack.IsEmpty, Is.False);
        }
예제 #7
0
        public void if_the_stack_lenght_is_one_and_pop_that_the_isEmpty_is_true()
        {
            var stack = new LajtiStack();

            stack.Push(456);
            stack.Pop();
            Assert.That(stack.IsEmpty, Is.True);
        }
예제 #8
0
        public void when_OneItem_Added_I_Can_Popp_It()
        {
            var stack = new LajtiStack();

            stack.Push(123);
            var result = stack.Pop();

            Assert.That(result, Is.EqualTo(123));
        }