public void Peek_StackWithItems_ReturnsTopItem() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); var result = stack.Peek(); Assert.That(stack.Peek(), Is.EqualTo("b")); }
public void Peek_StackWithObject_ReturnObjectOnTopOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("abc"); Assert.That(stack.Peek(), Is.EqualTo("abc")); }
public void Peek_EmptyStack_ThrowInvalidOperatorException() { var stack = new Fundamentals.Stack <string>(); // stack.Push(T); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_WhenCalledOnEmptyStack_ThrowsInvalidOperationException() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act & Assert Assert.Throws <InvalidOperationException>(() => stack.Peek()); }
public void Peek_StackWithObject_DoesNotRemoveTheObjectAtTheTopOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); var dummy = stack.Peek(); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Peek_StackIsNotEmpty_DoesNotRemoveObjectOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("1"); stack.Push("2"); stack.Push("3"); stack.Peek(); Assert.That(stack.Count == 3); }
public void Peek_StackWithAFewObj_ReturnObjOnTopOfStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); Assert.That(() => stack.Peek(), Is.EqualTo("c")); }
public void Peek_Peeking_ReturnsTopStackValue() { var stack = new Fundamentals.Stack <int>(); stack.Push(1); stack.Push(2); var result = stack.Peek(); Assert.That(result, Is.EqualTo(2)); }
public void Peek_StackWithItems_CountDoesntChange() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); var result = stack.Peek(); Assert.That(stack.Count, Is.EqualTo(2)); }
public void Peek_StackIsNotEmpty_PickElementFromStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("1"); stack.Push("2"); stack.Push("3"); var lastElement = stack.Peek(); Assert.That(lastElement == "3"); }
public void PeekMethod_WhenCalled_ReturnLastElementInStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Peek(); Assert.That(result, Is.EqualTo("c")); }
public void Peek_StackWithAFewObjects_ListSizeRemainsTheSame() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Peek(); Assert.That(stack.Count, Is.EqualTo(3)); }
public void Push_WhenCalled_AddsItemToStackAndIncrementsCount() { // Arrange var stack = new Fundamentals.Stack <int>(); // Act stack.Push(1); // Assert Assert.Equal(1, stack.Count); Assert.Equal(1, stack.Peek()); }
public void Peek_StackWithFewObjects_KeepTheSameStackCount() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); stack.Peek(); Assert.That(stack.Count, Is.EqualTo(3)); }
public void Peek_StackWhithAFewObjects_ReturnObjectOnTheTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Peek(); Assert.That(result, Is.EqualTo("c")); }
public void Peek_StackWhithAFewObjects_DontRemoveObjectOnTheTop() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); stack.Peek(); Assert.That(stack.Count, Is.EqualTo(3)); }
public void Peek_StackWithObjects_DoesNotRemoveTheObjectOnTopOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); stack.Peek(); Assert.That(stack.Count, Is.EqualTo(3)); }
public void PeekMethod_WhenCalled_DoesNotRemoveTheObject() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); var result = stack.Peek(); Assert.That(stack.Count, Is.EqualTo(3)); }
public void Peek_WithAFewObjects_DoesNotRemoveAnyObject() { //Arrange var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); //Act stack.Peek(); //Assert Assert.That(stack.Count, Is.EqualTo(3)); }
public void Peek_WhenCalledOnNonEmptyStack_ReturnsTopStackItem() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act stack.Push(1); stack.Push(2); var result = stack.Peek(); // Assert Assert.Equal(2, result); }
public void Peek_WithAFewObjects_ReturnsObjectAtTopOfStack() { //Arrange var stack = new Fundamentals.Stack <string>(); stack.Push("a"); stack.Push("b"); stack.Push("c"); //Act var result = stack.Peek(); //Assert Assert.That(result, Is.EqualTo("c")); }
public void Peek_StackCountZero_throwException() { Assert.Throws <InvalidOperationException>(() => stack.Peek()); }
public void PeekMethod_EmptyStack_ThrowsInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Peek(), Throws.Exception.TypeOf <InvalidOperationException>()); }
public void Peek_StackIsEmpty_ReturnInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_CountIsZero_ReturnsInvalidOperationException() { var stack = new Fundamentals.Stack <object>(); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_Throws_InvalidOperationException_When_Stack_Is_Empty() { Fundamentals.Stack <string> strings = new Fundamentals.Stack <string>(); Assert.Throws <InvalidOperationException>(() => strings.Peek()); }
public void Peek_ListCountIsZero_ThrowInvalidOperationException() { Assert.Throws <InvalidOperationException>(() => _stack.Peek()); }
public void Peek_WhenCalledOnZeroCountStack_ReturnsInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_NoObjInStack_ThrowInvalidOperationException() { var stack = new Fundamentals.Stack <string>(); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_Return_Last_Item_In_Stack() { int actualResult = _stack.Peek(); Assert.AreEqual(actualResult, 3); }