Skip to content

Commit 6fd4895

Browse files
test: add unit tests for StackUsingLinkedList
1 parent 5978973 commit 6fd4895

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/test/java/com/thealgorithms/stacks/StackUsingLinkedListTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.thealgorithms.stacks;
2-
2+
import static org.junit.jupiter.api.Assertions.*;
33
import org.junit.jupiter.api.BeforeEach;
44
import org.junit.jupiter.api.Test;
55

6-
import static org.junit.jupiter.api.Assertions.*;
6+
77

88
public class StackUsingLinkedListTest {
99
private StackUsingLinkedList<Integer> stack;
@@ -51,8 +51,7 @@ public void testPopOnEmptyStack() {
5151
}
5252
@Test
5353
public void testPeekOnEmptyStackThrowsException() {
54-
RuntimeException exception =
55-
assertThrows(RuntimeException.class, () -> stack.peek());
54+
RuntimeException exception = assertThrows(RuntimeException.class, () -> stack.peek());
5655
assertEquals("Stack is empty", exception.getMessage());
5756
}
5857
}

0 commit comments

Comments
 (0)