public void Pop_Valid_TopItem() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Pop(); Assert.That(stack.Pop(), Is.EqualTo("a")); }
public void Pop_WhenCalledOnList_RemovesLastItem() { var stack = new Fundamentals.Stack <string>(); var obj1 = "string"; //first item var obj2 = "secondstring"; //second item stack.Push(obj1); stack.Push(obj2); stack.Pop(); var result = stack.Pop(); Assert.That(result, Is.EqualTo(obj1)); }
public void Pop_EmptyStack_ThrowInvalidOperationException() { //Arrange var stack = new Fundamentals.Stack <string>(); //Assert Assert.That(() => stack.Pop(), Throws.InvalidOperationException); }
public void Pop_WhenCalledOnEmptyStack_ThrowsInvalidOperationException() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act & Assert Assert.Throws <InvalidOperationException>(() => stack.Pop()); }
public void Pop_Returns_Last_Value_In_Stack() { Fundamentals.Stack <int> numbers = new Fundamentals.Stack <int>(); numbers.Push(1); numbers.Push(2); numbers.Push(3); Assert.AreEqual(numbers.Pop(), 3); }
public void Pop_StackWithAFewObjects_RemoveObjectOnTheTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); var result = stack.Pop(); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Pop_StackIsNotEmpty_RemoveObjectFromStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("1"); stack.Push("2"); stack.Push("3"); stack.Pop(); Assert.That(stack.Count == 2); }
public void Pop_StackWithAFewObjects_ReturnObjectOnTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); Assert.That(stack.Pop(), Is.EqualTo("c")); }
public void Pop_Valid_Remove() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); var result = stack.Pop(); Assert.That(result, Is.EqualTo("b")); }
public void Pop_StackIsNotEmpty_ReturnsObjectFromStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("1"); stack.Push("2"); stack.Push("3"); var lastElement = stack.Pop(); Assert.That(lastElement == "3"); }
public void Pop_StackWithFewObjects_RemoveObjectFromTopOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); stack.Pop(); Assert.That(stack.Count, Is.EqualTo(2)); }
public void PopMethod_FewObjects_RemoveThisObjectFromTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Pop(); Assert.That(stack.Count, Is.EqualTo(2)); }
public void Pop_StackWithAFewObj_ObjIsRemoved() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); stack.Pop(); Assert.That(stack.Count, Is.EqualTo(2)); }
public void PopMethod_FewObjects_ReturnTheObjectOnTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Pop(); Assert.That(result, Is.EqualTo("c")); }
public void Pop_StackWithAFewObj_ReturnObjOnTopOfStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Pop(); Assert.That(result, Is.EqualTo("c")); }
public void Pop_WithAFewObjects_RemoveObjectOnTheTopOfStack() { //Arrange var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); //Act stack.Pop(); //Assert Assert.That(stack.Count, Is.EqualTo(2)); }
public void Pop_RemoveItemFromList_CountIsOneLess() { var stack = new Fundamentals.Stack <object>(); for (var i = 0; i < 5; i++) { stack.Push(new object()); } stack.Pop(); var result = stack.Count; Assert.That(result, Is.EqualTo(4)); }
public void Pop_WhenCalledOnNonEmptyStack_ReturnsTopStackItemAndDecrementsCount() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act stack.Push(1); stack.Push(2); var result = stack.Pop(); // Assert Assert.Equal(2, result); Assert.Equal(1, stack.Count); }
public void Pop_WithAFewObjects_ReturnObjectOnTheTop() { //Arrange (Bringing Object to correct stage before ready for testing) var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); //Act var result = stack.Pop(); //Assert Assert.That(result, Is.EqualTo("c")); }
public void Peek_WhenCalledOnList_ReturnsLastItem() { var stack = new Fundamentals.Stack <string>(); var obj1 = "string"; var obj2 = "secondstring"; stack.Push(obj1); stack.Push(obj2); var lastItem = stack.Pop(); Assert.That(lastItem, Is.EqualTo(obj2)); }
public void Pop_StackWithFewObjects_ReturnsObjectOnTop() { //Arrange var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); //Act var result = stack.Pop(); //Assert Assert.That(result, Is.EqualTo("b")); }
public void PopMethod_EmptyStack_ThrowsInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Pop(), Throws.Exception.TypeOf <InvalidOperationException>()); }
public void Pop_WithoutObjects_ReturnInvalidOperationException() { Assert.That(() => _stack.Pop(), Throws.Exception.TypeOf <InvalidOperationException>()); }
public void Pop_StackCountZero_throwException() { Assert.Throws <InvalidOperationException>(() => stack.Pop()); }
public void Pop_ListCountIsZero_ThrowInvalidOperationException() { Assert.Throws <InvalidOperationException>(() => _stack.Pop()); }
public void Pop_Throws_InvalidOperationException_When_Called_On_Empty_Stack() { Fundamentals.Stack <int> numbers = new Fundamentals.Stack <int>(); Assert.That(() => numbers.Pop(), Throws.InvalidOperationException); }
public void Pop_Removes_Popped_Item_From_List() { _stack.Pop(); Assert.AreEqual(_stack.Count, 2); }
public void Pop_NoObjInStack_ThrowInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Pop(), Throws.InvalidOperationException); }
public void Pop_StackCountIsZero_ThrowsInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Pop(), Throws.InvalidOperationException); }
public void Pop_ListCountEquals0_InvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Pop(), Throws.InvalidOperationException); }