Skip to content
Snippets Groups Projects
Commit 337f636b authored by Martin Schmollinger's avatar Martin Schmollinger
Browse files

Added basic test class for class LinkedList

parent bc5da36f
No related branches found
No related tags found
No related merge requests found
package io.ad.structs;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
//TODO Complete Test class.
public class LinkedListTest {
LinkedList<Integer> testList;
@BeforeEach
void setup() {
testList = new LinkedList<>();
testList.add(0);
testList.add(1);
testList.add(2);
}
@Test
void testCreateEmptyList() {
LinkedList<Integer> emptyList = new LinkedList<>();
assertEquals(0, emptyList.size());
}
@Test
void testSize() {
int currentSize = testList.size();
testList.add(3);
assertEquals(currentSize+1, testList.size());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment