Guest User

WordSearchSolver Horizontal Test

a guest
Sep 25th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import java.util.*;
  2. public class WordSearchSolverTest extends junit.framework.TestCase
  3. {
  4. private char board[][];
  5. private ArrayList<String> wordlist;
  6.  
  7. public WordSearchSolverTest()
  8. {
  9. }
  10.  
  11. public void testOneHorizontal()
  12. {
  13. char [][] board = { {'X', 'X','X','X'},
  14. {'X', 'C','A','T'},
  15. {'X', 'X','X','X'},
  16. {'X', 'X','X','X'}};
  17. wordlist.add("CAT");
  18. WordSearchSolver ws = new WordSearchSolver(3, board, wordlist);
  19. ArrayList<PuzzleWord> results = ws.findwords();
  20. assertEquals("wrong number of results",1,results.size());
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment