public void Setup() { _stack = new Fundamentals.Stack <int>(); _stack.Push(1); _stack.Push(2); _stack.Push(3); }
public void Push_ObjectAddedToList_ListIsEqualToOne() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Push_ValidArgumnet_AddTheObjectToTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Push_ObjectIsNull_ThrowObjectNullException(string T) { var stack = new Fundamentals.Stack <string>(); // stack.Push(T); Assert.That(() => stack.Push(T), Throws.ArgumentNullException); }
public void Peek_EmptyStack_ThrowInvalidOperatorException() { var stack = new Fundamentals.Stack <string>(); // stack.Push(T); Assert.That(() => stack.Peek(), Throws.InvalidOperationException); }
public void Peek_StackWithObject_ReturnObjectOnTopOfTheStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("abc"); Assert.That(stack.Peek(), Is.EqualTo("abc")); }
public void Push_InputIsCorrectObject_AddObjectToStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("aaa"); Assert.That(stack.Count == 1); }
public void Push_WhenCalled_AddItemToList() { var stack = new Fundamentals.Stack <int>(); stack.Push(1); Assert.That(stack.Count == 1); }
public void PushMethod_Object_AddItem() { var newItem = "a"; var stack = new Fundamentals.Stack <string>(); stack.Push(newItem); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Push_WhenObjectIsNotNull_ReturnObjectCount() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Push_WhenNullAdded_ThrowsArgumentNullException() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act & Arrange Assert.Throws <ArgumentNullException>(() => stack.Push(null)); }
public void Count_NoObjInStack_ReturnZero() { var stack = new Fundamentals.Stack <string>(); var result = stack.Count; Assert.That(result, Is.EqualTo(0)); }
public void Peek_WhenCalledOnEmptyStack_ThrowsInvalidOperationException() { // Arrange var stack = new Fundamentals.Stack <int?>(); // Act & Assert Assert.Throws <InvalidOperationException>(() => stack.Peek()); }
public void Push_ArgIsValid_AddObjToStack() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Pop_EmptyStack_ThrowInvalidOperationException() { //Arrange var stack = new Fundamentals.Stack <string>(); //Assert Assert.That(() => stack.Pop(), Throws.InvalidOperationException); }
public void Count_OneObjInStack_ReturnOne() { var stack = new Fundamentals.Stack <string>(); stack.Push("a"); var result = stack.Count; Assert.That(result, Is.EqualTo(1)); }
public void Push_AddObjectToList_ReturnWithAddedObjectToStack() { //Arrange var stack = new Fundamentals.Stack <string>(); stack.Push("a"); Assert.That(stack.Count, Is.EqualTo(1)); }
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 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_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_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 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_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_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 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_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_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 Push_WhenCalledOnEmptyStack_StackIsNotEmpty() { var stack = new Fundamentals.Stack <string>(); var obj = "string"; stack.Push(obj); Assert.That(stack.Count, Is.EqualTo(1)); }
public void Push_AddValidObject_ValidObjectAtTopOfStack() { var stack = new Fundamentals.Stack <object>(); var newObject = new Object(); stack.Push(newObject); //Assert.That(stack.) }
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)); }