public void AtFunctionShouldThrowExceptionWhenStackIsEmpty() { var stack = new MyStack(); int index = 4; Assert.Throws <IndexOutOfRangeException>(() => stack.At(index)); }
public void AtFunctionShouldReturnProperElementFromIndex() { var stack = new MyStack(); int index = 0; stack.Push(TEST_ELEMENT); Assert.AreEqual(TEST_ELEMENT, stack.At(index)); }
public void AtFunctionShouldThrowExceptionWhenIndexIsGreaterThanStackSize() { var stack = new MyStack(); int index = 2; stack.Push(TEST_ELEMENT); Assert.Throws <IndexOutOfRangeException>(() => stack.At(index)); }