Skip to content

Commit 6801baa

Browse files
committed
fix: unit test order
1 parent 0348174 commit 6801baa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/dataStructures/stack/StackTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ public class StackTest {
77
@Test
88
public void testEmpty(){
99
Stack<Integer> stk = new Stack<>();
10-
Assert.assertEquals(stk.pop(), null);
11-
Assert.assertEquals(stk.peek(), null);
10+
Assert.assertEquals(null, stk.pop());
11+
Assert.assertEquals(null, stk.peek());
1212
}
1313

1414
@Test
1515
public void testPopAndPeek() {
1616
Stack<Integer> stk = new Stack<>(1, 2, 3);
17-
Assert.assertEquals(stk.peek().toString(), "3");
18-
Assert.assertEquals(stk.pop().toString(), "3");
19-
Assert.assertEquals(stk.peek().toString(), "2");
17+
Assert.assertEquals("3", stk.peek().toString());
18+
Assert.assertEquals("3", stk.pop().toString());
19+
Assert.assertEquals("2", stk.peek().toString());
2020
}
2121

2222
@Test
2323
public void testPush() {
2424
Stack<Integer> stk = new Stack<>();
2525
stk.push(1);
26-
Assert.assertEquals(stk.peek().toString(), "1");
26+
Assert.assertEquals("1", stk.peek().toString());
2727
stk.push(2);
2828
stk.push(3);
29-
Assert.assertEquals(stk.peek().toString(), "3");
29+
Assert.assertEquals("3", stk.peek().toString());
3030
}
3131

3232
}

0 commit comments

Comments
 (0)