public void CannotPeekEmpty_Peek_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); // Assert Assert.Throws <NutmegException>(() => stack.Peek()); }
public void CannotPeekEmptyLocked_Peek_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); stack.Push("p"); stack.Push("q"); stack.Lock(); // Assert stack.Peek(); // No exceptio thrown - unchecked. }
public void Simple_PeekAndPeekItem_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); // Act stack.Push("a"); stack.Push("b"); var b = stack.Peek(); var a = stack.PeekItem(1); // Assert Assert.Equal("b", b); Assert.Equal("a", a); }