Package tests

Class StackTest

java.lang.Object
tests.StackTest

public class StackTest extends Object
A test class for testing the MyArrayList class with the StackADT interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks that the peek method is returning the last element in the ArrayList.
    void
    Checks that the peek method throws NoSuchElementException if the list is empty.
    void
    Checks that the pop method is removing the element from the list.
    void
    Checks that the pop method throws NoSuchElementException if the list is empty.
    void
    Checks that the push method is adding the element to the list.
    void
    Checks that the push method by verifying if a null element was not added to the list.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StackTest

      public StackTest()
  • Method Details

    • test_Push

      @Test public void test_Push()
      Checks that the push method is adding the element to the list.
    • test_Push_Invalid

      @Test public void test_Push_Invalid()
      Checks that the push method by verifying if a null element was not added to the list.
    • test_Pop

      @Test public void test_Pop()
      Checks that the pop 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 the peek method is returning the last element in the ArrayList.
    • test_Peek_Invalid

      @Test public void test_Peek_Invalid()
      Checks that the peek method throws NoSuchElementException if the list is empty.