File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
- import org .junit .Test ;
2
- import static org .junit .Assert .*;
1
+ import org .junit .jupiter .api .DisplayName ;
2
+ import org .junit .jupiter .api .Test ;
3
+ import static org .junit .jupiter .api .Assertions .*;
3
4
4
5
import com .galvanize .Stack ;
5
6
6
7
public class StackTestCase {
7
8
8
- @ Test
9
+ @ Test ()
10
+ @ DisplayName ("Stack.push() adds a new object" )
9
11
public void testStackPush () {
10
12
Stack newStack = new Stack ();
11
13
assertEquals (0 , newStack .count ());
@@ -15,6 +17,7 @@ public void testStackPush() {
15
17
}
16
18
17
19
@ Test
20
+ @ DisplayName ("Stack.pop() removes and returns last item added." )
18
21
public void testStackPopRemovesAndReturnsLastItemIn () {
19
22
Stack newStack = new Stack ();
20
23
newStack .push (1 );
@@ -27,10 +30,11 @@ public void testStackPopRemovesAndReturnsLastItemIn() {
27
30
}
28
31
29
32
@ Test
33
+ @ DisplayName ("Stack.peek() returns the last item added without removing it." )
30
34
public void testStackPeek () {
31
35
Stack newStack = new Stack ();
32
- newStack .push (1 );
33
- newStack .push (2 );
34
- assertEquals (2 , newStack .peek ());
36
+ newStack .push ("sock" );
37
+ newStack .push ("shoe" );
38
+ assertEquals ("shoe" , newStack .peek ());
35
39
}
36
40
}
You can’t perform that action at this time.
0 commit comments