public void SimplePop_Pop_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); stack.Push("a"); stack.Push("b"); // Act var b = stack.Pop(); var a = stack.Pop(); // Assert Assert.True(stack.IsEmpty()); Assert.Equal(0, stack.Size()); Assert.Equal("b", b); Assert.Equal("a", a); }
public void CannotPopEmpty_Pop_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); // Assert Assert.Throws <NutmegException>(() => stack.Pop()); }
public void CannotPopEmptyLocked_Pop_Test() { // Arrange var stack = new UncheckedLayeredStack <string>(); stack.Push("p"); stack.Push("q"); stack.Lock(); // Assert stack.Pop(); // Does not throw an exception. Unchecked. }