public void TryPeekAt_Should_NotFailIfIndexToBig() { // arrange var stack = new StackableList <int>(); // act stack.Add(10); stack.Add(11); var result = stack.TryPeekAt(3, out var peekedElement); // assert Assert.Equal(0, peekedElement); Assert.False(result); }
public void TryPeekAt_Should_ReturnElementAtPosition() { // arrange var stack = new StackableList <int>(); // act stack.Add(10); stack.Add(11); var result = stack.TryPeekAt(1, out var peekedElement); // assert Assert.Equal(10, peekedElement); Assert.True(result); }