Created
May 28, 2010 09:33
-
-
Save okoye/416966 to your computer and use it in GitHub Desktop.
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
import static org.junit.Assert.*; | |
import java.util.ArrayList; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
public class TrieStructureTest | |
{ | |
@Before | |
public void setUp() throws Exception | |
{ | |
} | |
@After | |
public void tearDown() throws Exception | |
{ | |
} | |
@Test | |
public void testPutWord() | |
{ | |
TrieStructure x = new TrieStructure(); | |
ArrayList<Integer> y; | |
assertTrue(x.putWord("chuka", 25)); | |
assertTrue(x.putWord("cab", 30)); | |
assertTrue(x.putWord("0chuka", 10)); | |
assertTrue(x.putWord("xylophone", 17)); | |
assertTrue(x.putWord("random", 1000)); | |
assertTrue(x.getWordIndexes("chuka").contains(25)); | |
assertTrue(x.getWordIndexes("xylophone").contains(17)); | |
// assertFalse(x.putWord("", 21)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment