public void Peek_ForNonEmptyStack_Success() { IBasicStack <int> stack = new BasicStack <int>(1); var itemValue = stack.Peek(); Assert.Equal(1, itemValue); }
public void FailPopOnEmpty() { var sut = new BasicStack <int>(); // Assert Assert.Throws <InvalidOperationException>(() => sut.Peek()); Assert.Throws <InvalidOperationException>(() => sut.Pop()); }
public void Peek_ForEmptyStack_ThrowsException() { IBasicStack <int> stack = new BasicStack <int>(); Assert.ThrowsAny <Exception>(() => stack.Peek()); }