Skip to content
Snippets Groups Projects
Commit 400c2183 authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Added pop() stub, added testPopFromHeightOneValue()

parent 77eb46e5
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,10 @@ public class MyStack { ...@@ -15,6 +15,10 @@ public class MyStack {
this.top = new Node(element, top); this.top = new Node(element, top);
} }
public Object pop() {
return null;
}
private class Node { private class Node {
private Object payload; private Object payload;
private int height; private int height;
......
...@@ -19,7 +19,7 @@ public class MyStackTest { ...@@ -19,7 +19,7 @@ public class MyStackTest {
private void pushDummies(int numberOfDummies) { private void pushDummies(int numberOfDummies) {
for (int i=0; i<numberOfDummies; i++) { for (int i=0; i<numberOfDummies; i++) {
stack.push(new Object()); stack.push(i+1);
} }
} }
...@@ -39,4 +39,10 @@ public class MyStackTest { ...@@ -39,4 +39,10 @@ public class MyStackTest {
pushDummies(3); pushDummies(3);
assertEquals(3, stack.size()); assertEquals(3, stack.size());
} }
@Test
public void testPopFromHeightOneValue() {
pushDummies(1);
assertEquals(1, stack.pop());
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment