public void Count_PushSeveralPopAll_ReturnZero() { Stack target = new Stack(); //Push several items target.Push("a"); target.Push("b"); target.Push("c"); target.Push("d"); target.Push("e"); target.Push("f"); target.Push("g"); //Pop all items target.Pop(); target.Pop(); target.Pop(); target.Pop(); target.Pop(); target.Pop(); target.Pop(); int expected = 0; int actual = target.Count(); Assert.AreEqual(expected, actual); }
public void Count_CalledOnNewStack_ReturnZero() { Stack target = new Stack(); int expected = 0; int actual = target.Count(); Assert.AreEqual(expected, actual); }
public void Count_PushOneItem_ReturnOne() { Stack target = new Stack(); target.Push("a"); int expected = 1; int actual = target.Count(); Assert.AreEqual(expected, actual); }
public void Count_PushSevenItems_ReturnSeven() { Stack target = new Stack(); target.Push("a"); target.Push("b"); target.Push("c"); target.Push("d"); target.Push("e"); target.Push("f"); target.Push("g"); int expected = 7; int actual = target.Count(); Assert.AreEqual(expected,actual); }
public void Push_SeveralItemsStackCallCount_ReturnItemCount() { Stack target = new Stack(); target.Push("a"); target.Push("b"); target.Push("c"); target.Push("d"); int expected = 4; int actual = target.Count(); Assert.AreEqual(expected, actual); }
public void Pop_PushSeveralItemsPopOneAndCount_ReturnNMinusOne() { Stack target = new Stack(); target.Push("a"); target.Push("b"); target.Push("c"); target.Push("d"); target.Push("e"); target.Push("f"); target.Pop(); int expected = 5; int actual = target.Count(); Assert.AreEqual(expected, actual); }
public void Pop_PushOneItemPopCount_ReturnZero() { Stack target = new Stack(); String testItem = "My apples are bad"; target.Push(testItem); target.Pop(); int expected = 0; int actual = target.Count(); Assert.AreEqual(expected, actual); }