Esempio n. 1
0
        public void ShouldReturnSameSizeWhenPeek()
        {
            var cut   = new ListBasedStackImplementation <int>(10);
            var items = new List <int> {
                18, 5, -6, 36, 48
            };

            items.ForEach(item => cut.Push(item));

            foreach (var item in items)
            {
                Assert.AreEqual(items.Last(), cut.Peek());
                Assert.AreEqual(items.Count, cut.CurrentSize);
            }
        }
Esempio n. 2
0
 public void ShouldThrowExceptionWhenPeekOnEmptyStack()
 {
     var cut  = new ListBasedStackImplementation <int>(1);
     var item = cut.Peek();
 }