Guest User

Untitled

a guest
May 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import static org.junit.Assert.*;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.junit.After;
  6. import org.junit.Before;
  7. import org.junit.Test;
  8.  
  9.  
  10. public class TrieStructureTest
  11. {
  12.  
  13. @Before
  14. public void setUp() throws Exception
  15. {
  16.  
  17. }
  18.  
  19. @After
  20. public void tearDown() throws Exception
  21. {
  22. }
  23.  
  24. @Test
  25. public void testPutWord()
  26. {
  27. TrieStructure x = new TrieStructure();
  28. ArrayList<Integer> y;
  29.  
  30. assertTrue(x.putWord("chuka", 25));
  31. assertTrue(x.putWord("cab", 30));
  32. assertTrue(x.putWord("0chuka", 10));
  33. assertTrue(x.putWord("xylophone", 17));
  34. assertTrue(x.putWord("random", 1000));
  35. assertTrue(x.getWordIndexes("chuka").contains(25));
  36. assertTrue(x.getWordIndexes("xylophone").contains(17));
  37. // assertFalse(x.putWord("", 21));
  38.  
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment