public void should_return_false_when_trypop_from_empty() { IStack <int> stack = new Services.Stack <int>(); int result; stack.TryPop(out result).Should().BeFalse(); }
public void should_return_true_when_trypop_after_push() { IStack <int> stack = new Services.Stack <int>(); stack.Push(123); int popped; bool result = stack.TryPop(out popped); result.Should().BeTrue(); popped.Should().Be(123); }
public void should_still_contain_items_after_trypop() { IStack <int> stack = new Services.Stack <int>(); stack.Push(321); int popped; stack.TryPop(out popped); Action act = () => stack.Pop(); act.Should().NotThrow(); }