Package tests
Class DLL_Test
java.lang.Object
tests.DLL_Test
A test class for testing
MyDLList
class.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Tests that theaddFirst
method adds an element into the first index.void
Checks if theaddLast
method is adding the element to the last index.void
Checks that thecontains
method is returning the correct value.void
Checks that theisEmpty
method is working.void
Tests theremoveFirst
method by checking if it returns null when a new doubly linked list is empty.void
Checks theremoveFirst
method is removing the first element.void
Tests for when the list is empty, a null value is returned.void
Tests theremoveLast
method by checking if the last index of a list no longer contains a certain element.void
Checks that the list size is the expected output.
-
Constructor Details
-
DLL_Test
public DLL_Test()
-
-
Method Details
-
test_IsEmpty_Valid
Checks that theisEmpty
method is working.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_addFirst
Tests that theaddFirst
method adds an element into the first index.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_addLast
Checks if theaddLast
method is adding the element to the last index.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_removeFirst_Valid
Checks theremoveFirst
method is removing the first element.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_removeFirst_Invalid
@Test public void test_removeFirst_Invalid()Tests theremoveFirst
method by checking if it returns null when a new doubly linked list is empty.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.
-
test_removeLast_Valid
Tests theremoveLast
method by checking if the last index of a list no longer contains a certain element.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_removeLast_Invalid
@Test public void test_removeLast_Invalid()Tests for when the list is empty, a null value is returned. -
test_size_Valid
Checks that the list size is the expected output.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-
test_contains_Valid
Checks that thecontains
method is returning the correct value.- Throws:
IllegalArgumentException
- Occurs when a method has been passed the wrong argument.IllegalAccessException
- SeeIllegalAccessException
for more information.
-