public void PopAndCount() { var stack = new stackv2.Stack <int>(); stack.Push(2); stack.Push(4); stack.Push(8); Assert.AreEqual(3, stack.Count()); Assert.AreEqual(8, stack.Pop()); Assert.AreEqual(2, stack.Count()); Assert.AreEqual(4, stack.Pop()); Assert.AreEqual(1, stack.Count()); }
public void PushUndCount() { var stack = new stackv2.Stack <int>(); stack.Push(10); var result = stack.Count(); Assert.AreEqual(1, result); }
public void PushTwoEntries() { var stack = new stackv2.Stack <bool>(); stack.Push(true); stack.Push(false); var result = stack.Count(); Assert.AreEqual(2, result); }