public void RemoveThePoppedItem() { // Arrange var stackedList = new StackedList<int>(); stackedList.Push(0); stackedList.Push(1); stackedList.Push(2); stackedList.Push(3); // Act stackedList.Pop(); // Assert Assert.That(!stackedList.Items.Contains(3)); }
public void ReturnTheLastItemPushed() { // Arrange var stackedList = new StackedList<int>(); stackedList.Push(0); stackedList.Push(1); stackedList.Push(2); stackedList.Push(3); // Act var poppedItem = stackedList.Pop(); // Assert Assert.That(poppedItem.Equals(3)); }
public void ReturnTheLastItemPushed() { // Arrange var stackedList = new StackedList <int>(); stackedList.Push(0); stackedList.Push(1); stackedList.Push(2); stackedList.Push(3); // Act var poppedItem = stackedList.Pop(); // Assert Assert.That(poppedItem.Equals(3)); }
public void RemoveThePoppedItem() { // Arrange var stackedList = new StackedList <int>(); stackedList.Push(0); stackedList.Push(1); stackedList.Push(2); stackedList.Push(3); // Act stackedList.Pop(); // Assert Assert.That(!stackedList.Items.Contains(3)); }
public void ReturnTheCorrectCountGivenPoppedItems(int initialNumberOfItems, int numberOfItemsToPop) { // Arrange var stackedList = new StackedList <int>(); // Add the items... for (var i = 1; i <= initialNumberOfItems; i++) { stackedList.Push(i); } // Pop some items... for (var i = 1; i <= numberOfItemsToPop; i++) { stackedList.Pop(); } // Act var itemCount = stackedList.Count; // Assert Assert.That(itemCount.Equals(initialNumberOfItems - numberOfItemsToPop)); }
public void ReturnTheCorrectCountGivenPoppedItems(int initialNumberOfItems, int numberOfItemsToPop) { // Arrange var stackedList = new StackedList<int>(); // Add the items... for (var i = 1; i <= initialNumberOfItems; i++) { stackedList.Push(i); } // Pop some items... for (var i = 1; i <= numberOfItemsToPop; i++) { stackedList.Pop(); } // Act var itemCount = stackedList.Count; // Assert Assert.That(itemCount.Equals(initialNumberOfItems - numberOfItemsToPop)); }