public void testPrintStackUpEmptyStack() { // ARRANGE StackLabCode.stack myStack = new StackLabCode.stack(1); // ACT // ASSERT Assert.Throws <StackLabCode.StackEmptyException>(() => myStack.printStackUp()); }
public void testPrintStackUp() { // ARRANGE StackLabCode.stack myStack = new StackLabCode.stack(2); string item = "StackItem"; string actual, expected; expected = "StackItem1\nStackItem2\n"; // ACT myStack.push(item + "1"); myStack.push(item + "2"); actual = myStack.printStackUp(); // ASSERT Assert.Equal(expected, actual); Assert.False(myStack.isEmpty()); }