Created
August 23, 2016 22:35
-
-
Save lchanmann/9d03f8b0b6fe91d93bd0615d7c6d1d87 to your computer and use it in GitHub Desktop.
JMinitest: assert linklist's head and tail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList(); | |
assert list.size() == 0 : "Expected 0 but was " + list.size(); | |
assert list.getHead() == null : "Expecte null but was " + list.getHead(); | |
assert list.getTail() == null : "Expecte null but was " + list.getTail(); | |
// All tests are passed! | |
System.out.println("All tests are passed!"); | |
} | |
} | |
// LinkedList class | |
class LinkedList { | |
public Object getHead() { | |
return null; | |
} | |
public Object getTail() { | |
return null; | |
} | |
public int size() { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment