Beispiel #1
0
        public void Should_not_throw_if_popingordefault_an_empty_stack()
        {
            var stack = new Stack <int>();

            AssertHelpers.DoesNotThrow(() =>
            {
                stack.PopOrDefault();
                stack.PopOrDefault();
                stack.PopOrDefault();
            });
        }
Beispiel #2
0
        public void Should_not_throw_when_begining_several_times_from_empty_stack()
        {
            var stack = new StackWithTransactions <int>();

            AssertHelpers.DoesNotThrow(() =>
            {
                stack.Begin();
                stack.Begin();
                stack.Begin();
                stack.Begin();
                stack.Begin();
            });
        }
Beispiel #3
0
        public void Should_not_throw_when_toping_an_empty_stack()
        {
            var stack = new StackWithTransactions <int>();

            AssertHelpers.DoesNotThrow(() =>
            {
                stack.Top();
                stack.Top();
                stack.Top();
                stack.Top();
                stack.Top();
                stack.Top();
                stack.Top();
            });
        }