Package tests

Class ArrayListTest

java.lang.Object
tests.ArrayListTest

public class ArrayListTest extends Object
A test class for testing the MyArrayList class.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Tests that when trying to add a null value that it will throw a null pointer exception and not increase its size.
    void
    Tests that the add method is able to add elements and increases the size.
    void
    Tests that the addAll method will copy one array into another.
    void
    Tests that the AddALl method will throw a NullPointer exception if we pass null into the parameter.
    void
    Tests that the set method throws NullPointerException when given a null value to the changeTo param.
    void
    Test that the value returned by the get method is correct.
    void
    Test that the get method throws an IndexOutOfBoundsException when an incorrect index is entered.
    void
    Tests that the IsEmpty returns true if size == 0 and false if it is greater than 0.
    void
    Tests that the remove method removes the value stored at the given index.
    void
    Tests that the remove method throws IndexOutOfBoundsException if given an incorrect index.
    void
    Tests that the set method changes the value of the given index with the new value.
    void
    Tests that the set method throws NullPointerException when given a null value to the changeTo param.
    void
    Tests that the MyArrayList size method is working correctly.
    void
    Tests the toArray method from MyArrayList
    void
    Tests that a NullPointerException is thrown if given a null array for the param.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait