Ejemplo n.º 1
0
        public void whent_the_stack_notepty_the_IsEmpty_is_false()
        {
            var stack = new LajtiStack();

            stack.Push(456);
            Assert.That(stack.IsEmpty, Is.False);
        }
Ejemplo n.º 2
0
        public void WhenAnItemIsAddedToTheStackThenTheNumberOfItemsIsOneAndtheStackIsNotEmptyAnyMore()
        {
            var stack = new LajtiStack();

            stack.Push(123);
            Assert.That(stack.IsEmpty, Is.False);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
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));
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
0
        public void when_the_stack_is_epty_then_the_pop_equal_to_exeption()
        {
            var stack = new LajtiStack();

            Assert.Throws <InvalidOperationException>(() => stack.Pop());
        }
Ejemplo n.º 10
0
        public void TheStackIsEmptyAfterCreation()
        {
            var stack = new LajtiStack();

            Assert.That(stack.IsEmpty, Is.True);
        }
Ejemplo n.º 11
0
        public void If_the_stack_epty_the_cout_return_zero()
        {
            var stack = new LajtiStack();

            Assert.That(stack.Count, Is.EqualTo(0));
        }