Package tests
Class StackTest
java.lang.Object
tests.StackTest
A test class for testing the
MyArrayList
class
with the StackADT
interface.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks that thepeek
method is returning the last element in the ArrayList.void
Checks that thepeek
method throws NoSuchElementException if the list is empty.void
test_Pop()
Checks that thepop
method is removing the element from the list.void
Checks that the pop method throws NoSuchElementException if the list is empty.void
Checks that thepush
method is adding the element to the list.void
Checks that thepush
method by verifying if a null element was not added to the list.
-
Constructor Details
-
StackTest
public StackTest()
-
-
Method Details
-
test_Push
@Test public void test_Push()Checks that thepush
method is adding the element to the list. -
test_Push_Invalid
@Test public void test_Push_Invalid()Checks that thepush
method by verifying if a null element was not added to the list. -
test_Pop
@Test public void test_Pop()Checks that thepop
method is removing the element from the list. -
test_Pop_Invalid
@Test public void test_Pop_Invalid()Checks that the pop method throws NoSuchElementException if the list is empty. -
test_Peek
@Test public void test_Peek()Checks that thepeek
method is returning the last element in the ArrayList. -
test_Peek_Invalid
@Test public void test_Peek_Invalid()Checks that thepeek
method throws NoSuchElementException if the list is empty.
-